A container that can either be a Failure containing an E or Success containing a value, semantically a combination of Either and Try but specialized for E
Type parameters
- A
-
Type of the value this EOr can contain
Attributes
Members list
Value members
Concrete methods
Provides a next EOr if this one has a value, ignoring the value
Provides a next EOr if this one has a value, ignoring the value
Type parameters
- B
-
Type of value in next EOr
Value parameters
- next
-
Next EOr in case this one has a value
Attributes
- Returns
-
Next EOr or a new EOr containing E in this one
Filters this EOr by value in it, if it exists, using given function
Filters this EOr by value in it, if it exists, using given function
Value parameters
- condition
-
Filtering function
- filteredError
-
E conversion function
Attributes
- Returns
-
This EOr of a new EOr containing an E computed by given conversion function
Computes a new EOr using value in this, if it exists, with given flat mapping function
Computes a new EOr using value in this, if it exists, with given flat mapping function
Type parameters
- B
-
Type of the new value
Value parameters
- f
-
Flat mapping function
Attributes
- Returns
-
Computed EOr or a new EOr containing E in this one
Computes a new EOr using E in this, if it exists, with given flat mapping function
Computes a new EOr using E in this, if it exists, with given flat mapping function
Type parameters
- AA
-
Type of the new value
Value parameters
- f
-
E flat mapping function
Attributes
- Returns
-
This EOr or a computed EOr if this one has E
Folds this into a single value, handling both E and value conversions with given functions
Folds this into a single value, handling both E and value conversions with given functions
Type parameters
- B
-
Type of the desired result
Value parameters
- ifFailure
-
Conversion function for E
- ifSuccess
-
Conversion function for value
Attributes
- Returns
-
Converted result
Alias of onValue
Gets the value in this or falls back to given default value
Gets the value in this or falls back to given default value
Type parameters
- AA
-
Type of default value
Value parameters
- default
-
Default value to use in case this has E
Attributes
- Returns
-
Value in this or given default value
Handles E in this EOr, if it exists, by given partial function to compute a successful EOr
Handles E in this EOr, if it exists, by given partial function to compute a successful EOr
Type parameters
- AA
-
Type of value returned by partial function
Value parameters
- f
-
Partial function to handle E
Attributes
- Returns
-
A new EOr containing handled value if partial function was defined for E in this EOr or this EOr as is
Handles E in this EOr, if it exists, by given partial function to compute a new EOr
Handles E in this EOr, if it exists, by given partial function to compute a new EOr
Type parameters
- AA
-
Type of value in EOr returned by partial function
Value parameters
- f
-
Partial function to compute new EOr
Attributes
- Returns
-
Computed new EOr if partial function was defined for E in this EOr or this EOr as is
Converts value in this, if it exists, using given mapping function to make a new EOr
Converts value in this, if it exists, using given mapping function to make a new EOr
Type parameters
- B
-
Type of the new value
Value parameters
- f
-
Mapping function
Attributes
- Returns
-
A new EOr containing either the new value or E in this one
Converts E in this, if it exists, using given mapping function to make a new EOr
Converts E in this, if it exists, using given mapping function to make a new EOr
Value parameters
- f
-
E mapping function
Attributes
- Returns
-
This EOr or a new EOr containing computed E if this one has E
Performs a side-effect using error in this, if it exists
Performs a side-effect using error in this, if it exists
Type parameters
- U
-
Type of result of the side-effect
Value parameters
- f
-
Side-effecting function
Attributes
Performs a side-effect using value in this, if it exists
Performs a side-effect using value in this, if it exists
Type parameters
- U
-
Type of result of the side-effect
Value parameters
- f
-
Side-effecting function
Attributes
Provides an alternative EOr if this one has E, ignoring the E
Provides an alternative EOr if this one has E, ignoring the E
Type parameters
- AA
-
Type of value in alternative EOr
Value parameters
- alternative
-
Alternative EOr in case this one has E
Attributes
- Returns
-
This EOr or alternative if this one has E
Converts this EOr to an Either
Converts this EOr to an Either
Attributes
- Returns
-
An Either containing E in this EOr or value in this EOr
Filters this EOr by value in it, if it exists, using given function
Filters this EOr by value in it, if it exists, using given function
Value parameters
- condition
-
Filtering function
Attributes
- Returns
-
This EOr of a new EOr containing filtered error
- See also
Concrete fields
Whether or not this contains an E
Whether or not this contains an E
Attributes
Whether or not this contains a value
Whether or not this contains a value