br.com.objectos.git
Class MaybeObjectId

java.lang.Object
  extended by br.com.objectos.git.MaybeObjectId
All Implemented Interfaces:
br.com.objectos.core.object.ToStringObject
Direct Known Subclasses:
ObjectId

public abstract class MaybeObjectId
extends Object
implements br.com.objectos.core.object.ToStringObject

Represents an ObjectId or its absence.

Since:
1

Method Summary
static MaybeObjectId empty()
          Returns the instance representing the absence of a hash value.
abstract  ObjectId getObjectId()
          Returns this reference if it is an instance of ObjectId or throws an exception otherwise.
abstract  boolean isObjectId()
          Returns true if this object is an instance of ObjectId.
 String toString()
          Returns the string representation of this id as defined by the ToStringObject.formatToString(StringBuilder, int) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface br.com.objectos.core.object.ToStringObject
formatToString
 

Method Detail

empty

public static MaybeObjectId empty()
Returns the instance representing the absence of a hash value.

Returns:
the instance representing the absence of a hash value

getObjectId

public abstract ObjectId getObjectId()
Returns this reference if it is an instance of ObjectId or throws an exception otherwise.

Returns:
this reference if it is an instance of ObjectId
Throws:
NoSuchElementException - if this object is not an ObjectId

isObjectId

public abstract boolean isObjectId()
Returns true if this object is an instance of ObjectId.

Returns:
true if this object is an instance of ObjectId

toString

public final String toString()
Returns the string representation of this id as defined by the ToStringObject.formatToString(StringBuilder, int) method.

Overrides:
toString in class Object
Returns:
the string representation of this id


Copyright © 2020–2022 Objectos Software LTDA. All rights reserved.