Class Suppliers.SupplierOfInstance<T>

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

    private static class Suppliers.SupplierOfInstance<T>
    extends java.lang.Object
    implements Supplier<T>, java.io.Serializable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) T instance  
      private static long serialVersionUID  
    • Method Summary

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

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

      • instance

        final T instance
    • Constructor Detail

      • SupplierOfInstance

        SupplierOfInstance​(T instance)
    • 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>
        Specified by:
        get in interface java.util.function.Supplier<T>
        Returns:
        an instance of the appropriate type
      • equals

        public boolean equals​(@CheckForNull
                              java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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