Class LazyReference<T>
- java.lang.Object
-
- org.forgerock.openig.decoration.helper.LazyReference<T>
-
- Type Parameters:
T- expected type of the resolved reference object
public final class LazyReference<T> extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Resolves the encapsulated reference.static <R> LazyReference<R>newReference(Heap heap, JsonValue reference, Class<R> type, boolean optional)Builds a LazyReference dedicated to resolve the given (optional or not)referenceof typetypefrom the givenheap.
-
-
-
Method Detail
-
newReference
public static <R> LazyReference<R> newReference(Heap heap, JsonValue reference, Class<R> type, boolean optional)
Builds a LazyReference dedicated to resolve the given (optional or not)referenceof typetypefrom the givenheap.- Type Parameters:
R- expected resolved type of the reference- Parameters:
heap- Heap instance that will try to resolve the referencereference- Reference to be resolved (can be an inline declaration)type- expected resolved type of the referenceoptional- is this reference optional (returnnullif the givenreferencewraps anullvalue)- Returns:
- a new LazyReference
-
get
public T get() throws HeapException
Resolves the encapsulated reference. Notice that synchronization is done in the Heap, so no need to cover that here.- Returns:
- the resolved instance, or
nullif it was optional and not set. - Throws:
HeapException- if resolution failed, this error is the one thrown be the heap, untouched.
-
-