JsError

play.api.libs.json.JsError
See theJsError companion object
case class JsError(errors: Seq[(JsPath, Seq[JsonValidationError])]) extends JsResult[Nothing]

The result in case of parsing errors.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait JsResult[Nothing]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

final class WithFilter(p: A => Boolean)

Attributes

Inherited from:
JsResult
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def ++(error: JsError): JsError
def asEither: Either[Seq[(JsPath, Seq[JsonValidationError])], Nothing]

Returns either the result errors (at Left), or the successful value (at Right).

Returns either the result errors (at Left), or the successful value (at Right).

Attributes

def contains[AA](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'''

Attributes

def exists(p: Nothing => 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'''

Attributes

def flatMap[U](f: Nothing => 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.

Attributes

def fold[U](invalid: Seq[(JsPath, Seq[JsonValidationError])] => U, valid: Nothing => U): U

Either applies the invalid function if this result is an error, or applies the valid function on the successful value.

Either applies the invalid function if this result is an error, or applies the valid function on the successful value.

Attributes

def forall(p: Nothing => Boolean): Boolean

If this result is successful than check value with predicate '''p''', otherwise return '''true'''. Follows scala.collection.Traversable.forall semantics

If this result is successful than check value with predicate '''p''', otherwise return '''true'''. Follows scala.collection.Traversable.forall semantics

Attributes

def foreach(f: Nothing => 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.

Attributes

def get: Nothing

Not recommended

Not recommended

Attributes

def getOrElse[U](t: => U): U

Either returns the successful value, or the value from t.

Either returns the successful value, or the value from t.

Attributes

def map[U](f: Nothing => 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.

Attributes

def orElse[U](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.

Attributes

def recover[U](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.

Attributes

def recoverTotal[U](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.

Attributes

def recoverWith[U](errManager: JsError => 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.

Attributes

def repath(path: JsPath): JsResult[Nothing]

Updates the JSON path

Updates the JSON path

Attributes

Inherited methods

def collect[B](otherwise: JsonValidationError)(p: PartialFunction[Nothing, B]): JsResult[B]

Attributes

Inherited from:
JsResult
def filter(otherwise: JsError)(p: Nothing => Boolean): JsResult[A]

Attributes

Inherited from:
JsResult
def filter(p: Nothing => Boolean): JsResult[A]

Attributes

Inherited from:
JsResult
def filterNot(p: Nothing => Boolean): JsResult[A]

Attributes

Inherited from:
JsResult
def filterNot(error: JsError)(p: Nothing => Boolean): JsResult[A]

Attributes

Inherited from:
JsResult
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def withFilter(p: Nothing => Boolean): WithFilter

Attributes

Inherited from:
JsResult

Concrete fields

val asOpt: Option[Nothing]

Transforms this result either Some option with the successful value, or as None in case of JSON error.

Transforms this result either Some option with the successful value, or as None in case of JSON error.

Attributes

val isError: Boolean
val isSuccess: Boolean