Class NamespacedHierarchicalStore.MemoizingSupplier

java.lang.Object
org.junit.platform.engine.support.store.NamespacedHierarchicalStore.MemoizingSupplier
All Implemented Interfaces:
Supplier<Object>
Enclosing class:
NamespacedHierarchicalStore<N>

private static class NamespacedHierarchicalStore.MemoizingSupplier extends Object implements Supplier<Object>
Thread-safe Supplier that memoizes the result of calling its delegate and ensures it is called at most once.

If the delegate throws an exception, it is stored and rethrown every time get() is called.

See Also:
  • Field Details

    • NO_VALUE_SET

      private static final Object NO_VALUE_SET
    • delegate

      private final Supplier<Object> delegate
    • value

      private volatile Object value
  • Constructor Details

    • MemoizingSupplier

      private MemoizingSupplier(Supplier<Object> delegate)
  • Method Details

    • get

      public Object get()
      Specified by:
      get in interface Supplier<Object>
    • computeValue

      private void computeValue()