Class Lazy.Default<T>

java.lang.Object
one.microstream.reference.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 Details

  • Method Details

    • genericType

      public static final Class<Lazy.Default<?>> genericType()
    • objectId

      public final long objectId()
    • lastTouched

      public final long lastTouched()
      Description copied from interface: Lazy
      Returns the timestamp (corresponding to System.currentTimeMillis()) when this instance has last been "touched", meaning having its reference modified or queried.
      Specified by:
      lastTouched in interface Lazy<T>
      Returns:
      the time this instance has last been significantly used.
    • 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.
    • clear

      public final boolean clear​(Lazy.ClearingEvaluator clearingEvaluator)
      Specified by:
      clear in interface Lazy<T>
    • 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object