Interface ConfigurationResource<T>

    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static <T> ConfigurationResource<T> of​(Supplier<T> supplier)
      Creates a configuration resource which lazily invokes the supplier.
      static <T> ConfigurationResource<T> of​(T instance)
      Creates a configuration resource with the instance as a constant.
      • Methods inherited from interface java.util.function.Supplier

        get
    • Method Detail

      • of

        static <T> ConfigurationResource<T> of​(Supplier<T> supplier)
        Creates a configuration resource which lazily invokes the supplier. Note that AutoCloseable.close() will only close the resource if Supplier.get() was first invoked to retrieve the value from the supplier.
        Parameters:
        supplier - the supplier used to create the configuration resource
        Returns:
        the configuration resource represented by a lazy instance
      • of

        static <T> ConfigurationResource<T> of​(T instance)
        Creates a configuration resource with the instance as a constant. Note that if AutoCloseable.close() is invoked, Supplier.get() will return null.
        Parameters:
        instance - the constant instance
        Returns:
        the configuration resource represented by a constant instance