Class CachedSupplier<T>

java.lang.Object
com.networknt.schema.CachedSupplier<T>
Type Parameters:
T - the type cached
All Implemented Interfaces:
Supplier<T>

public class CachedSupplier<T> extends Object implements Supplier<T>
Supplier that caches the output.
  • Field Details

    • delegate

      private volatile Supplier<T> delegate
    • cache

      private volatile T cache
  • Constructor Details

    • CachedSupplier

      public CachedSupplier(Supplier<T> delegate)
  • Method Details

    • get

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