java.lang.Object
org.microbean.invoke.FixedValueSupplier<T>
- All Implemented Interfaces:
Supplier<T>,OptionalSupplier<T>
An
OptionalSupplier implementation that supplies a fixed
value.- Author:
- Laird Nelson
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.microbean.invoke.OptionalSupplier
OptionalSupplier.Determinism -
Method Summary
Modifier and TypeMethodDescriptionReturnsOptionalSupplier.Determinism.PRESENTwhen invoked.final Tget()Returns the value supplied at construction time, which may benull.static final <T> FixedValueSupplier<T>of(T value) Returns aFixedValueSuppliersupplying the supplied value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.microbean.invoke.OptionalSupplier
exceptionally, handle, ifPresent, ifPresentOrElse, optional, optional, optional, orElse, orElseGet, orElseThrow, orElseThrow, stream
-
Method Details
-
determinism
ReturnsOptionalSupplier.Determinism.PRESENTwhen invoked.- Specified by:
determinismin interfaceOptionalSupplier<T>- Returns:
OptionalSupplier.Determinism.PRESENTwhen invoked- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
get
Returns the value supplied at construction time, which may benull.- Specified by:
getin interfaceOptionalSupplier<T>- Specified by:
getin interfaceSupplier<T>- Returns:
- the value supplied at construction time
- See Also:
- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method may return
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
of
Returns aFixedValueSuppliersupplying the supplied value.- Type Parameters:
T- the type of the value the returnedFixedValueSupplierwill supply- Parameters:
value- the value theget()method will return; may benull- Returns:
- a
FixedValueSuppliersupplying the supplied value - Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-