case class JsSuccess[T](value: T, path: JsPath = JsPath()) extends JsResult[T] with Product with Serializable
- Alphabetic
- By Inheritance
- JsSuccess
- Serializable
- Product
- Equals
- JsResult
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class WithFilter extends AnyRef
- Definition Classes
- JsResult
Value Members
- def asEither: Either[Seq[(JsPath, Seq[JsonValidationError])], T]
Returns either the result errors (at
Left
), or the successful value (atRight
).Returns either the result errors (at
Left
), or the successful value (atRight
).- Definition Classes
- → JsResult
- def asOpt: Option[T]
Transforms this result either
Some
option with the successful value, or asNone
in case of JSON error.Transforms this result either
Some
option with the successful value, or asNone
in case of JSON error.- Definition Classes
- → JsResult
- def collect[B](otherwise: JsonValidationError)(p: PartialFunction[T, B]): JsResult[B]
- Definition Classes
- JsResult
- def contains[AA >: T](elem: AA): Boolean
If this result is successful than checks for presence for elem, otherwise return false
If this result is successful than checks for presence for elem, otherwise return false
- Definition Classes
- → JsResult
- def exists(p: (T) => Boolean): Boolean
If this result is successful than check value with predicate p, otherwise return false
If this result is successful than check value with predicate p, otherwise return false
- Definition Classes
- → JsResult
- def filter(otherwise: JsError)(p: (T) => Boolean): JsResult[T]
- Definition Classes
- JsResult
- def filter(p: (T) => Boolean): JsResult[T]
- Definition Classes
- JsResult
- def filterNot(p: (T) => Boolean): JsResult[T]
- Definition Classes
- JsResult
- def filterNot(error: JsError)(p: (T) => Boolean): JsResult[T]
- Definition Classes
- JsResult
- def flatMap[U](f: (T) => JsResult[U]): JsResult[U]
If this result is successful, applies the function
f
on the parsed value.If this result is successful, applies the function
f
on the parsed value.- Definition Classes
- → JsResult
- def fold[U](invalid: (Seq[(JsPath, Seq[JsonValidationError])]) => U, valid: (T) => U): U
Either applies the
invalid
function if this result is an error, or applies thevalid
function on the successful value.Either applies the
invalid
function if this result is an error, or applies thevalid
function on the successful value.- Definition Classes
- → JsResult
- def forall(p: (T) => Boolean): Boolean
If this result is successful than check value with predicate p, otherwise return true.
If this result is successful than check value with predicate p, otherwise return true. Follows scala.collection.Traversable.forall semantics
- Definition Classes
- → JsResult
- def foreach(f: (T) => Unit): Unit
If this result is successful, applies the function
f
on the parsed value.If this result is successful, applies the function
f
on the parsed value.- Definition Classes
- → JsResult
- def get: T
Not recommended
Not recommended
- Definition Classes
- → JsResult
- def getOrElse[U >: T](t: => U): U
Either returns the successful value, or the value from
t
.Either returns the successful value, or the value from
t
.- Definition Classes
- → JsResult
- val isError: Boolean
- Definition Classes
- → JsResult
- val isSuccess: Boolean
- Definition Classes
- → JsResult
- def map[U](f: (T) => U): JsResult[U]
If this result is successful, applies the function
f
on the parsed value.If this result is successful, applies the function
f
on the parsed value.- Definition Classes
- → JsResult
- def orElse[U >: T](t: => JsResult[U]): JsResult[U]
Either returns this result if successful, or the result from
t
.Either returns this result if successful, or the result from
t
.- Definition Classes
- → JsResult
- val path: JsPath
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def recover[U >: T](errManager: PartialFunction[JsError, U]): JsResult[U]
If this result is not successful, recovers the errors with the given function.
If this result is not successful, recovers the errors with the given function.
- Definition Classes
- → JsResult
- def recoverTotal[U >: T](errManager: (JsError) => U): U
If this result is not successful, recovers the errors with the given function.
If this result is not successful, recovers the errors with the given function.
- Definition Classes
- → JsResult
- def recoverWith[U >: T](errManager: () => JsResult[U]): JsResult[U]
If this result is not successful, recovers the errors with the given function.
If this result is not successful, recovers the errors with the given function.
- Definition Classes
- → JsResult
- def repath(path: JsPath): JsResult[T]
Updates the JSON path
Updates the JSON path
- Definition Classes
- → JsResult
- val value: T
- def withFilter(p: (T) => Boolean): WithFilter
- Definition Classes
- JsResult
The result for a successful parsing.