Interface Reference<T>
- Type Parameters:
T- the type of value returned by the object
- All Known Subinterfaces:
Factory<T>
- All Known Implementing Classes:
ConcurrentLazyFactory,ConcurrentLazyReference,ConstantReference,LazyFactory,LazyReference
public interface Reference<T>
A reference to a value.
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the value.booleanIndicates if the value was initialized.
-
Method Details
-
getValue
T getValue()Returns the value. Subsequent invocations of this method return the same value.- Returns:
- an object of type
<T>
-
isInitialized
boolean isInitialized()Indicates if the value was initialized.A value may get initialized immediately after this method returns
falsebut once it returnstrueit will continue to do so indefinitely.- Returns:
trueif the value was initialized
-