Optional<T> class
abstract
- Implementers
- Available Extensions
Constructors
- Optional()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPresent → bool
-
no setter
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited
Methods
-
asEmpty(
) → Empty< T> -
asPresent(
) → Present< T> -
conditionally<
N> (bool condition(Optional< T> ), Optional<N> mapper(Optional<T> )) → Optional<N> -
equals(
T value) → bool -
filter(
Predicate< T> predicate) → Optional<T> -
flatMap<
N> (Optional< N> mapper(T)) → Optional<N> -
ifEmpty(
void ignored()) → Optional< T> -
ifPresent(
void action(T)) → Optional< T> -
map<
N> (N mapper(T)) → Optional< N> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
optionally<
X, N> (Optional< X> optional, Optional<N> optionalTuple(Optional<T> , Optional<X> )) → Optional<N> -
orElse(
Supplier< T> supplier) → T -
orElseGet(
T value) → T -
orThrow(
Exception exception) → T -
run(
void action(Optional< T> )) → Optional<T> -
toList(
) → List< T> -
toSet(
) → Set< T> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited