Class CachingSupplier<T>

java.lang.Object
com.networknt.schema.utils.CachingSupplier<T>
Type Parameters:
T - the type of results supplied by this supplier
All Implemented Interfaces:
Supplier<T>

public class CachingSupplier<T> extends Object implements Supplier<T>
Supplier that caches the value.

This is not threadsafe.

  • Field Details

    • delegate

      private final Supplier<T> delegate
    • cached

      private T cached
  • Constructor Details

    • CachingSupplier

      public CachingSupplier(Supplier<T> supplier)
  • Method Details

    • get

      public T get()
      Specified by:
      get in interface Supplier<T>