JsUndefined

play.api.libs.json.JsUndefined
See theJsUndefined companion object
final class JsUndefined(err: => String) extends JsLookupResult

Represent a missing Json value.

Attributes

Companion
object
Graph
Supertypes
trait JsReadable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def error: String
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

def as[T](implicit fjs: Reads[T]): T

Tries to convert the node into a T, throwing an exception if it can't. An implicit Reads[T] must be defined.

Tries to convert the node into a T, throwing an exception if it can't. An implicit Reads[T] must be defined.

Attributes

Inherited from:
JsReadable
def asOpt[T](implicit fjs: Reads[T]): Option[T]

Tries to convert the node into a T. An implicit Reads[T] must be defined. Any error is mapped to None

Tries to convert the node into a T. An implicit Reads[T] must be defined. Any error is mapped to None

Attributes

Returns

Some[T] if it succeeds, None if it fails.

Inherited from:
JsReadable
def get: JsValue

Attributes

Inherited from:
JsLookupResult
def getOrElse(v: => JsValue): JsValue

Attributes

Inherited from:
JsLookupResult
def isDefined: Boolean

Attributes

Inherited from:
JsLookupResult
def isEmpty: Boolean

Attributes

Inherited from:
JsLookupResult
def orElse(alternative: => JsLookupResult): JsLookupResult

If this result is defined return this. Otherwise return alternative.

If this result is defined return this. Otherwise return alternative.

Attributes

Inherited from:
JsLookupResult

Attributes

Inherited from:
JsLookupResult
def toOption: Option[JsValue]

Tries to convert the node into a JsValue

Tries to convert the node into a JsValue

Attributes

Inherited from:
JsLookupResult
def transform[A <: JsValue](rds: Reads[A]): JsResult[A]

Transforms this node into a JsResult using provided Json transformer Reads[JsValue]

Transforms this node into a JsResult using provided Json transformer Reads[JsValue]

Attributes

Inherited from:
JsReadable
def validate[A](implicit rds: Reads[A]): JsResult[A]

Tries to convert the node into a JsResult[T] (Success or Error). An implicit Reads[T] must be defined.

Tries to convert the node into a JsResult[T] (Success or Error). An implicit Reads[T] must be defined.

Attributes

Inherited from:
JsLookupResult
def validateOpt[A](implicit rds: Reads[A]): JsResult[Option[A]]

If this result contains JsNull or is undefined, returns JsSuccess(None). Otherwise returns the result of validating as an A and wrapping the result in a Some.

If this result contains JsNull or is undefined, returns JsSuccess(None). Otherwise returns the result of validating as an A and wrapping the result in a Some.

Attributes

Inherited from:
JsLookupResult