T
- - the type of the Referent object@ExperimentalApi public abstract class Reference<T> extends Object implements Iterable<T>
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 and Description |
---|
Reference()
Deprecated.
since 5.6 use @{link Reference#Reference(boolean)}
|
Modifier and Type | Method and Description |
---|---|
static <T> Reference<T> |
collapsed(Class<T> objClass) |
static <T> Reference<T> |
collapsed(Class<T> objClass,
Map idProperties) |
static <T> Reference<T> |
collapsed(T obj)
Create a collapse reference to the given object.
|
static <T> Reference<T> |
empty(Class<T> referrentClass)
Create an empty reference to the given class.
|
boolean |
equals(Object o) |
abstract boolean |
exists() |
boolean |
existsAndExpanded() |
abstract T |
get() |
abstract Map<Object,Object> |
getIdProperties()
A map of properties key by the idProperty enum in the model class for the referent object.
|
Object |
getIdProperty(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 <T> Reference<T> |
orEmpty(Reference<T> reference,
Class<T> referentClass) |
static <T> Reference<T> |
orEmpty(T entity,
Class<T> referentClass) |
abstract Class<? extends T> |
referentClass() |
static <T> Reference<T> |
to(T value)
Create an expanded reference to the referent value.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
forEach, iterator, spliterator
@Deprecated public Reference()
public abstract T get() throws IllegalStateException
IllegalStateException
public abstract boolean exists()
public abstract boolean isExpanded()
public abstract Map<Object,Object> getIdProperties()
public boolean existsAndExpanded()
public abstract Class<? extends T> referentClass()
public static <T> Reference<T> empty(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, Class<T> referentClass)
reference
- - the reference to return if it existsreferentClass
- - the class to create an empty reference to if reference doesn't existpublic static <T> Reference<T> collapsed(T obj)
obj
- - the object to create a collapsed reference topublic static <T> Reference<T> to(T value)
value
- - the object to create a reference toCopyright © 2003–2020 Atlassian. All rights reserved.