JsLookupResult

play.api.libs.json.JsLookupResult
See theJsLookupResult companion object
sealed trait JsLookupResult extends JsReadable

Attributes

Companion
object
Graph
Supertypes
trait JsReadable
class Any
Known subtypes
class JsDefined
class JsUndefined

Members list

Value members

Concrete methods

def \(index: Int): JsLookupResult
Implicitly added by jsLookupResultToJsLookup

Access a value of this array.

Access a value of this array.

Value parameters

index

Element index

Attributes

def \(fieldName: String): JsLookupResult
Implicitly added by jsLookupResultToJsLookup

Return the property corresponding to the fieldName, supposing we have a JsObject.

Return the property corresponding to the fieldName, supposing we have a JsObject.

Value parameters

fieldName

the name of the property to look up

Attributes

Returns

the resulting JsValue wrapped in a JsLookup. If the current node is not a JsObject or doesn't have the property, a JsUndefined will be returned.

def \\(fieldName: String): Seq[JsValue]
Implicitly added by jsLookupResultToJsLookup

Look up fieldName in the current object and all descendants.

Look up fieldName in the current object and all descendants.

Attributes

Returns

the list of matching nodes

def apply(index: Int): JsValue
Implicitly added by jsLookupResultToJsLookup

Access a value of this array.

Access a value of this array.

Value parameters

index

Element index.

Attributes

def apply(fieldName: String): JsValue
Implicitly added by jsLookupResultToJsLookup

Access a value of this array.

Access a value of this array.

Value parameters

fieldName

Element index.

Attributes

def get: JsValue
def getOrElse(v: => JsValue): JsValue
Implicitly added by jsLookupResultToJsLookup

Access the head of this array.

Access the head of this array.

Attributes

def isDefined: Boolean
def isEmpty: Boolean
Implicitly added by jsLookupResultToJsLookup

Access the last element of this array.

Access the last element of this array.

Attributes

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

Implicitly added by jsLookupResultToJsLookup

Access the tail of this array.

Access the tail of this array.

Attributes

def toOption: Option[JsValue]

Tries to convert the node into a JsValue

Tries to convert the node into a JsValue

Attributes

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

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 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 productElementNames: Iterator[String]
Implicitly added by jsLookupResultToJsLookup

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]
Implicitly added by jsLookupResultToJsLookup

Attributes

Inherited from:
Product
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