|
||||||||||
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()
|
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 |
|
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)
|
|
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 obj)
create an exanded reference to the referent object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Constructor Detail |
---|
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
- referrentClass
-
public static <T> Reference<T> orEmpty(Reference<T> reference, java.lang.Class<T> referentClass)
T
- reference
- referentClass
-
public static <T> Reference<T> orEmpty(T entity, java.lang.Class<T> referentClass)
public static <T> Reference<T> collapsed(T obj)
obj
-
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 obj)
obj
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |