None<T> class

None is a type that represents not having a value.

Inheritance
Annotations
  • @sealed

Constructors

None()
const

Properties

hashCode int
The hash code for this object.
no setteroverride
isNone bool
Returns true if the option is None.
no setterinherited
isSome bool
Returns true if the option is Some.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

and<U>(Option<U> optb) Option<U>
Returns None if the option is None, otherwise returns optb.
inherited
andThen<U>(Option<U> f(T value)) Option<U>
Returns None if the option is None, otherwise calls f with the wrapped value and returns the result.
inherited
expect(String msg) → T
Returns the contained Some value, consuming the this value.
inherited
filter(bool predicate(T value)) Option<T>
Returns None if the option is None, otherwise calls predicate with the wrapped value and returns:
inherited
iter() Iterable<T>
Returns an iterable over the possibly contained value.
inherited
map<U>(U op(T value)) Option<U>
Maps an Option<T> to Option<U> by applying a function to a contained value.
inherited
mapOr<U>(U defaultValue, U f(T value)) → U
Returns the provided default (if None), or applies a function to the contained value (if Some),
inherited
mapOrElse<U>(U defaultF(), U f(T value)) → U
Computes a default function result (if None), or applies a different function to the contained value (if Some).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
okOr<E>(E err) Result<T, E>
Transforms the Option into a Result, mapping Some(v) to Ok(v) and None to Err(err).
inherited
okOrElse<E>(E err()) Result<T, E>
Transforms the Option into a Result, mapping Some(v) to Ok(v) and None to Err(err()).
inherited
or(Option<T> optb) Option<T>
Returns the option if it contains a value, otherwise returns optb.
inherited
orElse(Option<T> f()) Option<T>
Returns the option if it contains a value, otherwise calls f and returns the result.
inherited
some() → T?
Converts from Option<T> to T?.
inherited
toString() String
A string representation of this object.
override
unwrap() → T
Returns the contained Some value, consuming the this value.
inherited
unwrapOr(T defaultValue) → T
Returns the contained Some value or a provided default.
inherited
unwrapOrElse(T op()) → T
Returns the contained Some value or computes it from a closure.
inherited
xor(Option<T> optb) Option<T>
Returns Some if exactly one of this, optb is Some, otherwise returns None.
inherited
zip<U>(Option<U> other) Option<Tuple2<T, U>>
Zips this with another Option.
inherited

Operators

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