BaseResult<T, E> class
BaseResult holds a value of type T or an error of type E.
BaseResult is used to return a result that's either ok or an error.
- Implementers
Constructors
- BaseResult.error(E? _error)
- BaseResult.error is the constructor for an error result.
- BaseResult.ok(T? _value)
- BaseResult.ok is the constructor for an ok result.
Properties
- error → E
-
error is a getter that returns the error.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ ResultState
-
getter/setter pair
- value → T
-
value is a getter that returns the value.
no setter
Methods
-
isError(
) → bool - isError returns true if Results represents an error.
-
isErrorAnd(
bool f(E)) → bool - isErrorAnd returns true if Results represents an error and the additional code of f returns true.
-
isOk(
) → bool - isOk returns true if Results represents an ok result.
-
isOkAnd(
bool f(T)) → bool - isOkAnd returns true if Results represents an ok result and the additional code of f returns true.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited