Class Suppliers.MemoizingSupplier<T>

  • All Implemented Interfaces:
    Supplier<T>, java.io.Serializable
    Enclosing class:
    Suppliers

    static class Suppliers.MemoizingSupplier<T>
    extends java.lang.Object
    implements Supplier<T>, java.io.Serializable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()
      Retrieves an instance of the appropriate type.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • initialized

        transient volatile boolean initialized
      • value

        transient T value
    • Constructor Detail

      • MemoizingSupplier

        MemoizingSupplier​(Supplier<T> delegate)
    • Method Detail

      • get

        public T get()
        Description copied from interface: Supplier
        Retrieves an instance of the appropriate type. The returned object may or may not be a new instance, depending on the implementation.
        Specified by:
        get in interface Supplier<T>
        Returns:
        an instance of the appropriate type
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object