Class NamespacedHierarchicalStore.MemoizingSupplier
- java.lang.Object
-
- org.junit.platform.engine.support.store.NamespacedHierarchicalStore.MemoizingSupplier
-
- All Implemented Interfaces:
java.util.function.Supplier<java.lang.Object>
- Enclosing class:
- NamespacedHierarchicalStore<N>
private static class NamespacedHierarchicalStore.MemoizingSupplier extends java.lang.Object implements java.util.function.Supplier<java.lang.Object>
Thread-safeSupplier
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:
NamespacedHierarchicalStore.StoredValue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
NamespacedHierarchicalStore.MemoizingSupplier.Failure
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Supplier<java.lang.Object>
delegate
private static java.lang.Object
NO_VALUE_SET
private java.lang.Object
value
-
Constructor Summary
Constructors Modifier Constructor Description private
MemoizingSupplier(java.util.function.Supplier<java.lang.Object> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
computeValue()
java.lang.Object
get()
-