Some<T> class final

An Option that has a value.

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

Some.new(T value)
Creates an Option with the associated immutable value.
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
value → T
The immutable value associated with this Option.
final

Methods

asNullable() → T?

Available on Option<T>, provided by the OptionConvenience extension

Returns Some.value or null for None.
map<R>(R mapper(T)) Option<R>

Available on Option<T>, provided by the OptionConvenience extension

Maps an Option
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
unwrapOr(T defaultValue) → T

Available on Option<T>, provided by the OptionConvenience extension

Returns Some.value if this is a Some. Otherwise, returns defaultValue (when None).
unwrapOrElse(T defaultFn()) → T

Available on Option<T>, provided by the OptionConvenience extension

Returns Some.value if this is a Some. Otherwise, calls and returns the result of defaultFn (when None).

Operators

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