Class SupplierOfInstance<T>

  • Type Parameters:
    T - type of instance
    All Implemented Interfaces:
    java.util.function.Supplier<T>

    public class SupplierOfInstance<T>
    extends java.lang.Object
    implements java.util.function.Supplier<T>
    Supplier returning a defined instance, with toString() implementation calling toString() on the instance without wrapping it.
    • Constructor Summary

      Constructors 
      Constructor Description
      SupplierOfInstance​(T instance)
      Creates a new instance supplier
    • Method Summary

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

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

      • SupplierOfInstance

        public SupplierOfInstance​(T instance)
        Creates a new instance supplier
        Parameters:
        instance - instance ot wrap
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface java.util.function.Supplier<T>
      • equals

        public boolean equals​(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