sealed trait JsResult[+A] extends AnyRef
- Alphabetic
- By Inheritance
- JsResult
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class WithFilter extends AnyRef
Abstract Value Members
- abstract def asEither: Either[Seq[(JsPath, Seq[JsonValidationError])], A]
Returns either the result errors (at
Left
), or the successful value (atRight
). - abstract def asOpt: Option[A]
Transforms this result either
Some
option with the successful value, or asNone
in case of JSON error. - abstract def contains[AA >: A](elem: AA): Boolean
If this result is successful than checks for presence for elem, otherwise return false
- abstract def exists(p: (A) => Boolean): Boolean
If this result is successful than check value with predicate p, otherwise return false
- abstract def flatMap[B](f: (A) => JsResult[B]): JsResult[B]
If this result is successful, applies the function
f
on the parsed value. - abstract def fold[B](invalid: (Seq[(JsPath, Seq[JsonValidationError])]) => B, valid: (A) => B): B
Either applies the
invalid
function if this result is an error, or applies thevalid
function on the successful value. - abstract def forall(p: (A) => 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
- abstract def foreach(f: (A) => Unit): Unit
If this result is successful, applies the function
f
on the parsed value. - abstract def get: A
Not recommended
- abstract def getOrElse[AA >: A](t: => AA): AA
Either returns the successful value, or the value from
t
. - abstract def isError: Boolean
- abstract def isSuccess: Boolean
- abstract def map[B](f: (A) => B): JsResult[B]
If this result is successful, applies the function
f
on the parsed value. - abstract def orElse[AA >: A](t: => JsResult[AA]): JsResult[AA]
Either returns this result if successful, or the result from
t
. - abstract def recover[AA >: A](errManager: PartialFunction[JsError, AA]): JsResult[AA]
If this result is not successful, recovers the errors with the given function.
- abstract def recoverTotal[AA >: A](errManager: (JsError) => AA): AA
If this result is not successful, recovers the errors with the given function.
- abstract def recoverWith[AA >: A](errManager: (JsError) => JsResult[AA]): JsResult[AA]
If this result is not successful, recovers the errors with the given function.
- abstract def repath(path: JsPath): JsResult[A]
Updates the JSON path
Concrete 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(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def collect[B](otherwise: JsonValidationError)(p: PartialFunction[A, B]): JsResult[B]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def filter(otherwise: JsError)(p: (A) => Boolean): JsResult[A]
- def filter(p: (A) => Boolean): JsResult[A]
- def filterNot(p: (A) => Boolean): JsResult[A]
- def filterNot(error: JsError)(p: (A) => Boolean): JsResult[A]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withFilter(p: (A) => Boolean): WithFilter
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)