Right biased Either[Err, A]
.
An Attempt
is either an Attempt.Successful
or an Attempt.Failure
. Attempts can be created
by calling Attempt.successful
or Attempt.failure
, as well as converting from an Option
via
fromOption
.
Attributes
- Companion:
- object
- Source:
- Attempt.scala
- Graph
- Supertypes
- Known subtypes
- class Failureclass Successful[A]
Members list
Value members
Abstract methods
Maps the supplied function over the successful value, if present.
Converts an Attempt[Attempt[X]]
in to an Attempt[X]
.
Transforms this attempt to a value of type B
using the supplied functions.
Transforms this attempt to a value of type B
using the supplied functions.
Attributes
- Source:
- Attempt.scala
Returns the sucessful value if successful, otherwise the supplied default.
Returns the sucessful value if successful, otherwise the supplied default.
Attributes
- Source:
- Attempt.scala
True if attempt was successful.
Maps the supplied function over the successful value, if present.
Maps the supplied function over the failure error, if present.
Returns this attempt if successful, otherwise the fallback attempt.
If this attempt is a failure, and the supplied partial function is defined for the cause of the failure, a successful attempt is returned. If this attempt is successful or the supplied function is not defined for the cause of the failure, this attempt is returned unmodified.
If this attempt is a failure, and the supplied partial function is defined for the cause of the failure, a successful attempt is returned. If this attempt is successful or the supplied function is not defined for the cause of the failure, this attempt is returned unmodified.
Attributes
- Source:
- Attempt.scala
If this attempt is a failure, and the supplied partial function is defined for the cause of the failure, the result of applying that function is returned. If this attempt is successful or the supplied function is not defined for the cause of the failure, this attempt is returned unmodified.
If this attempt is a failure, and the supplied partial function is defined for the cause of the failure, the result of applying that function is returned. If this attempt is successful or the supplied function is not defined for the cause of the failure, this attempt is returned unmodified.
Attributes
- Source:
- Attempt.scala
Returns the successful value if present; otherwise throws an IllegalArgumentException
.
Returns the successful value if present; otherwise throws an IllegalArgumentException
.
Attributes
- Source:
- Attempt.scala
Converts to an either.
Converts to an option, discarding the error value.
Converts to a try.
Concrete methods
True if attempt was not successful.