class Failure[Err] extends Result[Err, Nothing] with Product with Serializable
This class is used for a parser failure, and contains the error message.
- Err
the type of the error message generated by the failing parse.
- Source
- Result.scala
- Alphabetic
- By Inheritance
- Failure
- Serializable
- Serializable
- Product
- Equals
- Result
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
canEqual(x: Any): Boolean
- Definition Classes
- Failure → Equals
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
contains[B >: Nothing](elem: B): Boolean
Returns
trueif this result is aSuccessand its value is equal toelem(as determined by==), returnsfalseotherwise.Returns
trueif this result is aSuccessand its value is equal toelem(as determined by==), returnsfalseotherwise.- elem
the element to test.
- returns
trueif this is aSuccessvalue equal toelem.
- Definition Classes
- Result
- Since
1.7.0
- def copy(msg: ⇒ Err = this.msg): Failure[Err]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(x: Any): Boolean
- Definition Classes
- Failure → Equals → AnyRef → Any
-
def
exists(p: (Nothing) ⇒ Boolean): Boolean
Returns
falseifFailureor returns the result of the application of the given predicate to theSuccessvalue.Returns
falseifFailureor returns the result of the application of the given predicate to theSuccessvalue.- Definition Classes
- Result
- Since
1.7.0
-
def
filterOrElse[Errʹ >: Err](p: (Nothing) ⇒ Boolean, msg: ⇒ Errʹ): Result[Errʹ, Nothing]
Returns
Successwith the existing value ofSuccessif this is aSuccessand the given predicatepholds for the right value, orFailure(msg)if this is aSuccessand the given predicatepdoes not hold for the right value, orFailurewith the existing value ofFailureif this is aFailure.Returns
Successwith the existing value ofSuccessif this is aSuccessand the given predicatepholds for the right value, orFailure(msg)if this is aSuccessand the given predicatepdoes not hold for the right value, orFailurewith the existing value ofFailureif this is aFailure.- Definition Classes
- Result
- Since
1.7.0
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B, Errʹ >: Err](f: (Nothing) ⇒ Result[Errʹ, B]): Result[Errʹ, B]
Returns the result of applying
fto this result if it is a success.Returns the result of applying
fto this result if it is a success. Returns a failure if this result is a failure. Differs frommapasfreturns a result instead of just a value.- Definition Classes
- Result
- Since
1.7.0
-
def
flatten[B, Errʹ >: Err](implicit ev: <:<[Nothing, Result[Errʹ, B]]): Result[Errʹ, B]
Returns the nested result if this result is a success, otherwise return this failure.
Returns the nested result if this result is a success, otherwise return this failure.
Equivalent to
flatMap(identity[Result[Errʹ, B]]).- Definition Classes
- Result
- Since
1.7.0
-
def
fold[B](ferr: (Err) ⇒ B, fa: (Nothing) ⇒ B): B
Returns the result of applying
ferrto this result's error if this is aFailureorfato the result stored in theSuccessotherwise.Returns the result of applying
ferrto this result's error if this is aFailureorfato the result stored in theSuccessotherwise.- ferr
the function to apply if this is a
Failure.- fa
the function to apply if this is a
Success.- returns
the results of applying the function
- Definition Classes
- Result
- Since
1.7.0
-
def
forall(f: (Nothing) ⇒ Boolean): Boolean
Returns
trueif this result is aFailureor returns the result of the application of the given predicate to theSuccessvalue.Returns
trueif this result is aFailureor returns the result of the application of the given predicate to theSuccessvalue.- Definition Classes
- Result
- Since
1.7.0
-
def
foreach[U](f: (Nothing) ⇒ U): Unit
Executes the procedure
fif this is aSuccess.Executes the procedure
fif this is aSuccess. Otherwise, do nothing.This is equivalent to:
result match { case Success(x) => f(x) case _ => () }
- f
The side-effecting function to execute.
- Definition Classes
- Result
- Since
1.7.0
-
def
get: Nothing
Returns the successful value within the result.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getOrElse[B >: Nothing](default: ⇒ B): B
Returns the value from this
Successor the result of evaluatingdefaultif this is aFailure.Returns the value from this
Successor the result of evaluatingdefaultif this is aFailure.- Definition Classes
- Result
- Since
1.7.0
-
def
hashCode(): Int
- Definition Classes
- Failure → AnyRef → Any
-
def
isFailure: Boolean
Returns
trueif this is aFailure,falseotherwise. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSuccess: Boolean
Returns
trueif this is aSuccess,falseotherwise. -
def
map[B](f: (Nothing) ⇒ B): Result[Err, B]
Returns a
Successcontaining the result of applyingfto this result's value if this is a success.Returns a
Successcontaining the result of applyingfto this result's value if this is a success. Otherwise, returns a failure.- Definition Classes
- Result
- Since
1.7.0
- lazy val msg: Err
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
orElse[B >: Nothing, Errʹ >: Err](alternative: ⇒ Result[Errʹ, B]): Result[Errʹ, B]
Returns this result if it is a
Success, otherwise return the result of evaluatingalternative.Returns this result if it is a
Success, otherwise return the result of evaluatingalternative.- Definition Classes
- Result
- Since
1.7.0
-
def
productArity: Int
- Definition Classes
- Failure → Product
-
def
productElement(idx: Int): Any
- Definition Classes
- Failure → Product
-
def
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Failure → Product
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toEither: Either[Err, Nothing]
Converts the
Resultinto aEitherwhereFailuremaps to aLeft[Err].Converts the
Resultinto aEitherwhereFailuremaps to aLeft[Err].- Definition Classes
- Result
- Since
1.7.0
-
def
toOption: Option[Nothing]
Returns a
Somecontaining theSuccessvalue if it exists or aNoneif this is aFailure.Returns a
Somecontaining theSuccessvalue if it exists or aNoneif this is aFailure.- Definition Classes
- Result
- Since
1.7.0
-
def
toSeq: Seq[Nothing]
Returns a
Seqcontaining theSuccessvalue if it exists or an emptySeqif this is aFailure.Returns a
Seqcontaining theSuccessvalue if it exists or an emptySeqif this is aFailure.- Definition Classes
- Result
- Since
1.7.0
-
def
toString(): String
- Definition Classes
- Failure → AnyRef → Any
-
def
toTry: Try[Nothing]
Converts the
Resultinto aTrywhereFailuremaps to a plainException.Converts the
Resultinto aTrywhereFailuremaps to a plainException.- Definition Classes
- Result
- Since
1.7.0
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()