sealed abstract class Json extends Product with Serializable
- Alphabetic
- By Inheritance
- Json
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
-->>:(k: Json): Json
If this is a JSON array, then prepend the given value, otherwise, return a JSON array with only the given value.
-
def
-->>?:(o: Option[Json]): Json
If this is a JSON array, and the element is set, then prepend the given value, otherwise, return a JSON array with only the given value.
-
def
->:(k: Json.JsonAssoc): Json
If this is a JSON object, then prepend the given value, otherwise, return a JSON object with only the given value.
-
def
->?:(o: Option[Json.JsonAssoc]): Json
If this is a JSON object, and the association is set, then prepend the given value, otherwise, return a JSON object with only the given value.
-
def
-|(f: ⇒ Json.JsonField): Option[Json]
Alias for
field
. -
def
-||(fs: List[Json.JsonField]): Option[Json]
Returns a possible JSON value after traversing through JSON object values using the given field names.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
acursor: ACursor
Constructor a cursor from this JSON value to track history.
-
def
array: Option[Json.JsonArray]
Returns the possible array of this JSON value.
-
def
arrayOr(d: ⇒ Json.JsonArray): Json.JsonArray
Returns the array of this JSON value, or the given default if this JSON value is not an array.
Returns the array of this JSON value, or the given default if this JSON value is not an array.
- d
The default array if this JSON value is not an array.
-
def
arrayOrEmpty: Json.JsonArray
Returns the array of this JSON value, or an empty array if this JSON value is not an array.
-
def
arrayOrObject[X](or: ⇒ X, jsonArray: (Json.JsonArray) ⇒ X, jsonObject: (JsonObject) ⇒ X): X
Run on an array or object or return the given default.
-
def
as[A](implicit e: DecodeJson[A]): DecodeResult[A]
Attempts to decode this JSON value to another data type, alias for
jdecode
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
assoc: Option[List[Json.JsonAssoc]]
Returns the possible object of this JSON value as an association list.
-
def
bool: Option[Boolean]
Returns the possible boolean of this JSON value.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
cursor: Cursor
Constructor a cursor from this JSON value (alias for
unary_+
). -
def
deepmerge(y: Json): Json
Perform a deep merge of this JSON value with another JSON value.
Perform a deep merge of this JSON value with another JSON value.
Objects are merged by key, values from the argument JSON take precedence over values from this JSON. Nested objects are recursed.
Null, Array, Boolean, String and Number are treated as values, and values from the argument JSON completely replace values from this JSON.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
field(f: ⇒ Json.JsonField): Option[Json]
Returns the possible value for the given JSON object field.
-
def
fieldOr(f: ⇒ Json.JsonField, j: ⇒ Json): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns the default..
-
def
fieldOrEmptyArray(f: ⇒ Json.JsonField): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns an empty JSON array.
-
def
fieldOrEmptyObject(f: ⇒ Json.JsonField): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns an empty JSON object.
-
def
fieldOrEmptyString(f: ⇒ Json.JsonField): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns an empty JSON.
-
def
fieldOrFalse(f: ⇒ Json.JsonField): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns a JSON boolean with the value
false
. -
def
fieldOrNull(f: ⇒ Json.JsonField): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns a JSON
null
.. -
def
fieldOrTrue(f: ⇒ Json.JsonField): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns a JSON boolean with the value
true
. -
def
fieldOrZero(f: ⇒ Json.JsonField): Json
Returns the value for the given JSON object field if this is an object with the given field, otherwise, returns a JSON number with the value
0
. -
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fold[X](jsonNull: ⇒ X, jsonBool: (Boolean) ⇒ X, jsonNumber: (JsonNumber) ⇒ X, jsonString: (String) ⇒ X, jsonArray: (Json.JsonArray) ⇒ X, jsonObject: (JsonObject) ⇒ X): X
The catamorphism for the JSON value data type.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hasField(f: ⇒ Json.JsonField): Boolean
Returns
true
if this is a JSON object which has the given field,false
otherwise. -
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hcursor: HCursor
Constructor a cursor from this JSON value to track history.
-
def
isArray: Boolean
Return
true
if this JSON value is a array. -
def
isBool: Boolean
Return
true
if this JSON value is a boolean. -
def
isFalse: Boolean
Return
true
if this JSON value is a boolean with a value offalse
, otherwise,false
. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isNull: Boolean
Return
true
if this JSON value isnull
, otherwise,false
. -
def
isNumber: Boolean
Return
true
if this JSON value is a number. -
def
isObject: Boolean
Return
true
if this JSON value is a object. -
def
isString: Boolean
Return
true
if this JSON value is a string. -
def
isTrue: Boolean
Return
true
if this JSON value is a boolean with a value oftrue
, otherwise,false
. -
def
jdecode[A](implicit e: DecodeJson[A]): DecodeResult[A]
Attempts to decode this JSON value to another data type.
-
def
name: String
The name of the type of the JSON value.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nospaces: String
Pretty-print this JSON value to a string with no spaces.
-
def
nospacesWithOrder: String
Pretty-print this JSON value to a string with no spaces, preserving order.
-
def
not: Json
If this is a JSON boolean value, invert the
true
andfalse
values, otherwise, leave unchanged. -
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
number: Option[JsonNumber]
Returns the possible number of this JSON value.
-
def
numberOr(d: ⇒ JsonNumber): JsonNumber
Returns the number of this JSON value, or the given default if this JSON value is not a number.
Returns the number of this JSON value, or the given default if this JSON value is not a number.
- d
The default number if this JSON value is not a number.
-
def
numberOrZero: JsonNumber
Returns this JSON number object or the value
0
if it is not a number. -
def
obj: Option[JsonObject]
Returns the possible object of this JSON value.
-
def
objectFields: Option[List[Json.JsonField]]
Return the object keys if this JSON value is an object, otherwise, return the empty list.
-
def
objectFieldsOr(f: ⇒ List[Json.JsonField]): List[Json.JsonField]
Returns the object map keys of this JSON value, or the given default if this JSON value is not an object.
Returns the object map keys of this JSON value, or the given default if this JSON value is not an object.
- f
The default object map keys if this JSON value is not an object.
-
def
objectFieldsOrEmpty: List[Json.JsonField]
Returns the object map keys of this JSON value, or the empty list if this JSON value is not an object.
-
def
objectOr(d: ⇒ JsonObject): JsonObject
Returns the object of this JSON value, or the given default if this JSON value is not a object.
Returns the object of this JSON value, or the given default if this JSON value is not a object.
- d
The default object if this JSON value is not an object.
-
def
objectOrEmpty: JsonObject
Returns the object of this JSON value, or the empty object if this JSON value is not an object.
-
def
objectValues: Option[List[Json]]
Return the object values if this JSON value is an object, otherwise, return the empty list.
-
def
objectValuesOr(k: ⇒ List[Json]): List[Json]
Returns the object map values of this JSON value, or the given default if this JSON value is not an object.
Returns the object map values of this JSON value, or the given default if this JSON value is not an object.
- k
The default object map values if this JSON value is not an object.
-
def
objectValuesOrEmpty: List[Json]
Returns the object map values of this JSON value, or the empty list if this JSON value is not an object.
-
def
pretty(p: PrettyParams): String
Pretty-print this JSON value to a string using the given pretty-printing parameters.
-
def
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Product
-
def
spaces2: String
Pretty-print this JSON value to a string indentation of two spaces.
-
def
spaces4: String
Pretty-print this JSON value to a string indentation of four spaces.
-
def
string: Option[Json.JsonString]
Returns the possible string of this JSON value.
-
def
stringOr(d: ⇒ Json.JsonString): Json.JsonString
Returns the string of this JSON value, or the given default if this JSON value is not a string.
Returns the string of this JSON value, or the given default if this JSON value is not a string.
- d
The default string if this JSON value is not a string.
-
def
stringOrEmpty: Json.JsonString
Returns the string of this JSON value, or an empty string if this JSON value is not a string.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
Compute a
String
representation for this JSON value.Compute a
String
representation for this JSON value.- Definition Classes
- Json → AnyRef → Any
-
def
unary_+: Cursor
Constructor a cursor from this JSON value (alias for
cursor
). -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withArray(k: (Json.JsonArray) ⇒ Json.JsonArray): Json
If this is a JSON array value, run the given function on the value, otherwise, leave unchanged.
-
def
withNumber(k: (JsonNumber) ⇒ JsonNumber): Json
If this is a JSON number value, run the given function on the value, otherwise, leave unchanged.
-
def
withObject(k: (JsonObject) ⇒ JsonObject): Json
If this is a JSON object value, run the given function on the value, otherwise, leave unchanged.
-
def
withString(k: (Json.JsonString) ⇒ Json.JsonString): Json
If this is a JSON string value, run the given function on the value, otherwise, leave unchanged.