Package graphql.util

Class IntraThreadMemoizedSupplier<T>

  • Type Parameters:
    T - for two
    All Implemented Interfaces:
    java.util.function.Supplier<T>

    class IntraThreadMemoizedSupplier<T>
    extends java.lang.Object
    implements java.util.function.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 Summary

      Fields 
      Modifier and Type Field Description
      private java.util.function.Supplier<T> delegate  
      private static java.lang.Object SENTINEL  
      private T value  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SENTINEL

        private static final java.lang.Object SENTINEL
      • value

        private T value
      • delegate

        private final java.util.function.Supplier<T> delegate
    • Constructor Detail

      • IntraThreadMemoizedSupplier

        IntraThreadMemoizedSupplier​(java.util.function.Supplier<T> delegate)
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface java.util.function.Supplier<T>