Class ValueProvider<T>

  • Type Parameters:
    T - type of value this provider provides
    All Implemented Interfaces:
    java.util.function.Supplier<T>

    public class ValueProvider<T>
    extends java.lang.Object
    implements java.util.function.Supplier<T>
    Provider that always provides the specified value.
    Author:
    igor.vaynberg
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueProvider​(T value)
      Construct.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()  
      static <T> ValueProvider<T> of​(T value)
      Creates a provider for the specified value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValueProvider

        public ValueProvider​(T value)
        Construct.
        Parameters:
        value - value to provide
    • Method Detail

      • get

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

        public static <T> ValueProvider<T> of​(T value)
        Creates a provider for the specified value
        Type Parameters:
        T - type of value
        Parameters:
        value - value
        Returns:
        provider