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 Type
    Method
    Description
    Returns the value.
    boolean
    Indicates 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 false but once it returns true it will continue to do so indefinitely.

      Returns:
      true if the value was initialized