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.PRESENT
when invoked.final T
get()
Returns the value supplied at construction time, which may benull
.static final <T> FixedValueSupplier<T>
of
(T value) Returns aFixedValueSupplier
supplying the supplied value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.microbean.invoke.OptionalSupplier
exceptionally, handle, ifPresent, ifPresentOrElse, optional, optional, optional, orElse, orElseGet, orElseThrow, orElseThrow, stream
-
Method Details
-
determinism
ReturnsOptionalSupplier.Determinism.PRESENT
when invoked.- Specified by:
determinism
in interfaceOptionalSupplier<T>
- Returns:
OptionalSupplier.Determinism.PRESENT
when 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:
get
in interfaceOptionalSupplier<T>
- Specified by:
get
in 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 aFixedValueSupplier
supplying the supplied value.- Type Parameters:
T
- the type of the value the returnedFixedValueSupplier
will supply- Parameters:
value
- the value theget()
method will return; may benull
- Returns:
- a
FixedValueSupplier
supplying 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.
-