Class Lazy.Default<T>

  • All Implemented Interfaces:
    Lazy<T>, Referencing<T>
    Enclosing interface:
    Lazy<T>

    public static final class Lazy.Default<T>
    extends Object
    implements Lazy<T>
    • Constructor Detail

      • Default

        public Default()
    • Method Detail

      • objectId

        public final long objectId()
      • lastTouched

        public final long lastTouched()
      • isStored

        public final boolean isStored()
        Specified by:
        isStored in interface Lazy<T>
      • isLoaded

        public final boolean isLoaded()
        Specified by:
        isLoaded in interface Lazy<T>
      • peek

        public final T peek()
        Returns the wrapped reference without loading it on demand.
        Specified by:
        peek in interface Lazy<T>
        Returns:
        the current reference withouth on-demand loading.
      • clear

        public final T clear()
        Clears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.
        Specified by:
        clear in interface Lazy<T>
        Returns:
        the subject referenced prior to clearing the reference.
      • get

        public final T get()
        Returns the original subject referenced by this reference instance. If the subject has (lazily) not been loaded, an attempt to do so now is made. Any exception occuring during the loading attempt will be passed along without currupting this reference instance's internal state.
        Specified by:
        get in interface Lazy<T>
        Specified by:
        get in interface Referencing<T>
        Returns:
        the originally referenced subject, either already-known or lazy-loaded.