public class Reference<T>
extends java.lang.Object
get() method.| Modifier | Constructor and Description |
|---|---|
protected |
Reference() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Reference<T> |
create(java.lang.String typeId,
java.lang.String id) |
boolean |
equals(java.lang.Object o) |
T |
get()
Returns the object represented by this reference.
|
java.lang.String |
getId()
Id of the object this reference represents.
|
java.lang.String |
getTypeId()
Type id of the object this reference represents, e.g.
|
int |
hashCode() |
boolean |
isEmpty()
True if this reference has no value in the parent object.
|
boolean |
isExpanded()
True if this reference has been expanded.
|
ReferenceId<T> |
toReferenceIdOrNull() |
java.lang.String |
toString() |
Reference<T> |
toUnexpandedReference() |
public static <T> Reference<T> create(java.lang.String typeId, java.lang.String id)
public T get() throws ReferenceException
ReferenceException. Never returns null.ReferenceException - If this reference has not been expanded.public boolean isExpanded()
isExpanded() returns true, get() is guaranteed to return a non-null object.
User code should always check for isExpanded() before calling get().public boolean isEmpty()
isEmpty() returns true, there's not much to do with this reference - isExpanded()
will return false and all other methods will throw a ReferenceException.@Nonnull public java.lang.String getId()
@Nonnull public java.lang.String getTypeId()
public java.lang.String toString()
toString in class java.lang.Objectpublic ReferenceId<T> toReferenceIdOrNull()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object