|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.api.model.reference.Reference<T>
T
- - the type of the Referent object@ExperimentalApi public abstract class Reference<T>
A reference to a model object. References can be either expanded or collapsed. The object that a reference points to can either exist or not. If a reference both exists and is expanded then call to get() will return the referenced object. Collapsed References provide id properties that give just enough information to identify the referenced object. Model object that wish to be able to have references generated for them need to provide an enum named IdProperties. This enum must have values that match the name of the fields in the object that comprise it's ID.
Constructor Summary | |
---|---|
Reference()
Deprecated. since 5.6 use @{link Reference#Reference(boolean)} |
Method Summary | ||
---|---|---|
static
|
collapsed(java.lang.Class objClass)
|
|
static
|
collapsed(java.lang.Class objClass,
java.util.Map idProperties)
|
|
static
|
collapsed(T obj)
Create a collapse reference to the given object. |
|
static
|
empty(java.lang.Class<T> referrentClass)
Create an empty reference to the given class. |
|
boolean |
equals(java.lang.Object o)
|
|
abstract boolean |
exists()
|
|
abstract T |
get()
|
|
abstract java.util.Map<java.lang.Object,java.lang.Object> |
getIdProperties()
A map of properties key by the idProperty enum in the model class for the referent object. |
|
java.lang.Object |
getIdProperty(java.lang.Enum key)
|
|
int |
hashCode()
|
|
abstract boolean |
isExpanded()
indicates a reference is expanded and can be resolved to an object by calling get, or whether the reference is collapsed and calling get will throw an exception. |
|
static
|
orEmpty(Reference<T> reference,
java.lang.Class<T> referentClass)
|
|
static
|
orEmpty(T entity,
java.lang.Class<T> referentClass)
|
|
abstract java.lang.Class<? extends T> |
referentClass()
|
|
static
|
to(T value)
Create an expanded reference to the referent value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Constructor Detail |
---|
@Deprecated public Reference()
Method Detail |
---|
public abstract T get() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public abstract boolean exists()
public abstract boolean isExpanded()
public abstract java.util.Map<java.lang.Object,java.lang.Object> getIdProperties()
public java.lang.Object getIdProperty(java.lang.Enum key)
public abstract java.lang.Class<? extends T> referentClass()
public static <T> Reference<T> empty(java.lang.Class<T> referrentClass)
T
- the type to create a reference toreferrentClass
- the class of type of object to create a reference to.
public static <T> Reference<T> orEmpty(Reference<T> reference, java.lang.Class<T> referentClass)
reference
- - the reference to return if it existsreferentClass
- - the class to create an empty reference to if reference doesn't exist
public static <T> Reference<T> orEmpty(T entity, java.lang.Class<T> referentClass)
public static <T> Reference<T> collapsed(T obj)
obj
- - the object to create a collapsed reference to
public static <T> Reference<T> collapsed(java.lang.Class objClass)
public static <T> Reference<T> collapsed(java.lang.Class objClass, java.util.Map idProperties)
public static <T> Reference<T> to(T value)
value
- - the object to create a reference to
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |