Class CachedSupplier<T>

java.lang.Object
org.apache.kafka.clients.consumer.internals.CachedSupplier<T>
All Implemented Interfaces:
Supplier<T>

public abstract class CachedSupplier<T> extends Object implements Supplier<T>
Simple Supplier that caches the initial creation of the object and stores it for later calls to get().

Note: this class is not thread safe! Use only in contexts which are designed/guaranteed to be single-threaded.

  • Constructor Details

    • CachedSupplier

      public CachedSupplier()
  • Method Details

    • create

      protected abstract T create()
    • get

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