Nothing<T> class

Represents a non-existing value of type T.

Implemented types

Constructors

Nothing()
const

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

as<R>() Nothing<R>
WARNING! This method is experimental and may be removed in the future versions. Forceful typecast to R.
override
chain(Maybe<T> next) Maybe<T>
If this is Nothing, returns next. Otherwise return this..
override
fallback(Maybe<T> next()) Maybe<T>
If this is Nothing, returns the result of next. Otherwise return this..
override
flatMap<P>(Maybe<P> mapper(T value)) Nothing<P>
Maps the value to P.
override
ifNothing(void callback()) Nothing<T>
Calls the callback function if the wrapped value is not present.
override
ifPresent(void consumer(T value)) Nothing<T>
Calls the consumer if the wrapped value is present.
override
map<P>(P mapper(T value)) Nothing<P>
Maps the value to P.
override
merge<R, V>(Maybe<V> other, Merger<R, T, V> merger) Nothing<R>
If this and the other are both Just values, merges them using the merger function and returns Just
override
merge2<R, V1, V2>(Maybe<V1> v1, Maybe<V2> v2, Merger2<R, T, V1, V2> merger) Nothing<R>
Same as merge, but with 2 arguments.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
or(T defaultValue) → T
Returns the wrapped value (if present), or the defaultValue.
override
orAsync(Future<T> defaultValue) Future<T>
Returns a Future of the wrapped value (if present), or the defaultValue.
override
orGet(T producer()) → T
Returns the wrapped value (if present), or the result of the producer.
override
orGetAsync(Future<T> producer()) Future<T>
Returns a Future of the wrapped value (if present), or the result of the producer.
override
orThrow(Object producer()) → T
Returns the wrapped value (if present), or throws the result of the producer.
override
toString() String
A string representation of this object.
inherited
tryMap<P>(P mapper(T value)) Nothing<P>
Tries to map value to P. If the mapper throws anything (not just an Exception), returns Nothing<P>.
override
type<P>() Nothing<P>
Narrows the type to P if the value is present and has actually the type of P.
override
where(bool predicate(T value)) Nothing<T>
Filter the value using the predicate.
override

Operators

operator ==(Object other) bool
The equality operator.
override