case class PartialParseSuccess[+A](get: A, errors: Seq[ParseError]) extends ParseResult[A] with Product with Serializable
A ParseResult indicating a successful parse that had recoverable errors.
Contains both a result value and a list of errors.
- Alphabetic
- By Inheritance
- PartialParseSuccess
- Serializable
- Serializable
- Product
- Equals
- ParseResult
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new PartialParseSuccess(get: A, errors: Seq[ParseError])
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
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
collect[B](pf: PartialFunction[A, B]): ParseResult[B]
Apply a PartialFunction to the result value.
Apply a PartialFunction to the result value. If the
pf
function isn't defined for the result value a ParseFailure is returned.- Definition Classes
- ParseResult
-
final
def
collect[B](otherwise: ⇒ ParseError)(pf: PartialFunction[A, B]): ParseResult[B]
Apply a PartialFunction to the result value.
Apply a PartialFunction to the result value. If the
pf
isn't defined for the result value, a ParseFailure with theotherwise
error is returned.- Definition Classes
- ParseResult
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
val
errors: Seq[ParseError]
A sequence of all ParseErrors that occurred.
A sequence of all ParseErrors that occurred.
- Definition Classes
- PartialParseSuccess → ParseResult
-
def
filter(f: (A) ⇒ Boolean): ParseResult[A]
- f
Predicate to filter the ParseResult by
- returns
this if the test passes, or ParseFailure if the test fails.
- Definition Classes
- ParseResult
-
def
filter(error: ⇒ ParseError)(f: (A) ⇒ Boolean): ParseResult[A]
- error
The error to use if the test fails.
- f
Predicate to filter the ParseResult by
- returns
if the result is successful and the filter fails ParseFailure is returned
- Definition Classes
- ParseResult
-
def
flatMap[B](f: (A) ⇒ ParseResult[B]): ParseResult[B]
FlatMap over the result value.
FlatMap over the result value.
One thing to note is that if this is a PartialParseSuccess, then the errors are prepended to the result of calling
f
on the value. So for example, iff
returns a ParseSuccess, but this is a PartialParseSuccess the final result will be a PartialParseSuccess containing the result fromf
and the errors from this.- Definition Classes
- ParseResult
-
def
fold[B](onFailure: (Seq[ParseError]) ⇒ B)(onSuccess: (A) ⇒ B): B
Handle both success and failure.
Handle both success and failure.
- onFailure
Function to handle a ParseFailure.
- onSuccess
Function to process a successful parse.
- Definition Classes
- ParseResult
-
def
foreach(f: (A) ⇒ Unit): Unit
Execute
f
on the result value if and only if this ParseResult is successful.Execute
f
on the result value if and only if this ParseResult is successful.- f
the function to execute.
- Definition Classes
- ParseResult
- Annotations
- @inline()
-
val
get: A
- Definition Classes
- PartialParseSuccess → ParseResult
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
getOrElse[B >: A](otherwise: ⇒ B): B
- returns
the result value, unless this is a ParseFailure in which case return
otherwise
.
- Definition Classes
- ParseResult
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSuccessful: Boolean
Is the result a success, i.e.
Is the result a success, i.e. either a ParseSuccess or a PartialParseSuccess.
- Definition Classes
- PartialParseSuccess → ParseResult
-
def
map[B](f: (A) ⇒ B): ParseResult[B]
Map a function over the result value.
Map a function over the result value. The level of success, and any errors are propagated.
- Definition Classes
- ParseResult
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
or[B >: A](other: ParseResult[B]): ParseResult[B]
- returns
this if this is successful, otherwise return other if other is successful, and a
ParseFailure
containing errors from both if both failed.
- Definition Classes
- ParseResult
-
def
orElse[B >: A](otherwise: ⇒ ParseResult[B]): ParseResult[B]
Like
or
, but takeotherwise
as a by-name parameter, and don't combine errors from both.Like
or
, but takeotherwise
as a by-name parameter, and don't combine errors from both.- returns
this if this is successful otherwise return
otherwise
.
- Definition Classes
- ParseResult
-
def
recoverPartial[B >: A](otherwise: ⇒ B): ParseResult[B]
If this is a ParseFailure recover as a PartialParseSuccess containing
otherwise
so that the errors are kept.If this is a ParseFailure recover as a PartialParseSuccess containing
otherwise
so that the errors are kept.- Definition Classes
- ParseResult
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toOption: Option[A]
Convert to an Option
Convert to an Option
- returns
a Some containing the result if successful, or a None if a failure
- Definition Classes
- ParseResult
-
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()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withFilter(f: (A) ⇒ Boolean): ParseResult[A]
Alias for filter
Alias for filter
- Definition Classes
- ParseResult
-
def
|[B >: A](other: ParseResult[B]): ParseResult[B]
Alias for
or
Alias for
or
- Definition Classes
- ParseResult
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.