Package graphql.util

Class IntraThreadMemoizedSupplier<T>

java.lang.Object
graphql.util.IntraThreadMemoizedSupplier<T>
Type Parameters:
T - for two
All Implemented Interfaces:
Supplier<T>

class IntraThreadMemoizedSupplier<T> extends Object implements Supplier<T>
This memoizing supplier does NOT use synchronised double locking to set its value so on multiple threads it MAY call the delegate again to get a value.
  • Field Details

    • SENTINEL

      private static final Object SENTINEL
    • value

      private T value
    • delegate

      private final Supplier<T> delegate
  • Constructor Details

    • IntraThreadMemoizedSupplier

      IntraThreadMemoizedSupplier(Supplier<T> delegate)
  • Method Details

    • get

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