public interface JsValue
Modifier and Type | Method and Description |
---|---|
int |
id() |
default JsValue |
ifNothing(JsValue value)
returns the specified default value if nothing or the same this object
|
default JsValue |
ifNull(JsValue value)
returns the specified default value if null or the same this object
|
default boolean |
isArray()
Returns true if this JsValue is a JsArray
|
default boolean |
isArray(Predicate<JsArray> predicate)
Returns true if this elem is a JsArray and satisfies the given predicate
|
default boolean |
isBigDec()
Returns true if this JsValue is a JsBigDec
|
default boolean |
isBigDec(Predicate<BigDecimal> predicate)
Returns true if this elem is a JsBigDec and satisfies the given predicate
|
default boolean |
isBigInt()
Returns true if this JsValue is a JsBigInt
|
default boolean |
isBigInt(Predicate<BigInteger> predicate)
Returns true if this elem is a JsBigInt and satisfies the given predicate
|
default boolean |
isBinary()
Returns true if this JsValue is a JsBinary or a JsString which value is an array of
|
default boolean |
isBool()
Returns true if this JsValue is a JsBool
|
default boolean |
isDecimal()
Returns true if this element is a decimal number (JsDouble or JsBigDec)
|
default boolean |
isDouble()
Returns true if this JsValue is a JsDouble
|
default boolean |
isDouble(DoublePredicate predicate)
Returns true if this elem is a JsDouble and satisfies the given predicate
|
default boolean |
isFalse()
Returns true if this JsValue is a JsBool, and it's false
|
default boolean |
isInstant()
Returns true if this JsValue is a JsInstant or a JsString which value is a
date formatted in ISO-8601
|
default boolean |
isInstant(Predicate<Instant> predicate)
Returns true if this elem is a JsInstant and satisfies the given predicate
|
default boolean |
isInt()
Returns true if this JsValue is a JsInt
|
default boolean |
isInt(IntPredicate predicate)
Returns true if this elem is a JsInt and satisfies the given predicate
|
default boolean |
isIntegral()
Returns true if this element is an integral number (JsInt or JsLong or JsBigInt)
|
default boolean |
isJson()
Returns true if this JsValue is a Json (JsObj or JsArray)
|
default boolean |
isJson(Predicate<Json<?>> predicate)
Returns true if this elem is a Json and satisfies the given predicate
|
default boolean |
isLong()
Returns this JsValue as a JsLong
|
default boolean |
isLong(LongPredicate predicate)
Returns true if this elem is a JsLong and satisfies the given predicate
|
default boolean |
isNothing()
Returns true if this element is JsNothing
|
default boolean |
isNotNothing()
Returns true if this element is not JsNothing
|
default boolean |
isNotNull()
Return true if this element is not null
|
default boolean |
isNotNumber()
Returns true if this element is not a number
|
default boolean |
isNull()
Returns true if this element is null
|
default boolean |
isNumber()
Returns true if this element is a number
|
default boolean |
isObj()
Returns true if this JsValue is a JsObj
|
default boolean |
isObj(Predicate<JsObj> predicate)
Returns true if this elem is a JsObj and satisfies the given predicate
|
default boolean |
isPrimitive()
Returns true if this JsValue is a not a Json (neither JsObj nor JsArray)
|
default boolean |
isSameType(JsValue that)
returns true if this elem and the given have the same type
|
default boolean |
isStr()
Returns true if this JsValue is a JsStr
|
default boolean |
isStr(Predicate<String> predicate)
Returns true if this elem is a JsStr and satisfies the given predicate
|
default boolean |
isTrue()
Returns true if this JsValue is a JsBool, and it's true
|
default JsArray |
toJsArray()
Returns this JsValue as a JsArray
|
default JsBigDec |
toJsBigDec()
Returns this JsValue as a JsBigDec
|
default JsBigInt |
toJsBigInt()
Retruns this JsValue as a JsBigInt
|
default JsBinary |
toJsBinary()
Returns this JsValue as a JsBinary
|
default JsBool |
toJsBool()
Returns this JsValue as a JsBool
|
default JsDouble |
toJsDouble()
Returns this JsValue as a JsDouble
|
default JsInstant |
toJsInstant()
Returns this JsValue as a JsInstant
|
default JsInt |
toJsInt()
Returns this JsValue as a JsInt
|
default JsLong |
toJsLong()
Returns this JsValue as a JsLong
|
default JsNumber |
toJsNumber()
Returns this JsValue as a JsStr
|
default JsObj |
toJsObj()
Returns this JsValue as a JsObj
|
default Json<?> |
toJson()
Returns this JsValue as a Json
|
JsPrimitive |
toJsPrimitive() |
default JsStr |
toJsStr()
Returns this JsValue as a JsStr
|
int id()
default JsBool toJsBool()
UserError
- if this JsValue is not a JsBoolJsPrimitive toJsPrimitive()
default boolean isBinary()
default boolean isInstant()
default boolean isInstant(Predicate<Instant> predicate)
predicate
- the given predicatedefault boolean isBool()
default boolean isSameType(JsValue that)
that
- the given elemdefault boolean isTrue()
default boolean isFalse()
default boolean isInt(IntPredicate predicate)
predicate
- the given predicatedefault boolean isInt()
default JsInt toJsInt()
UserError
- if this JsValue is not a JsIntdefault JsInstant toJsInstant()
UserError
- if this JsValue is not a JsIntdefault JsBinary toJsBinary()
UserError
- if this JsValue is not a JsBinarydefault boolean isDouble(DoublePredicate predicate)
predicate
- the given predicatedefault boolean isDouble()
default JsDouble toJsDouble()
UserError
- if this JsValue is not a JsDoubledefault boolean isBigDec(Predicate<BigDecimal> predicate)
predicate
- the given predicatedefault boolean isBigDec()
default JsBigDec toJsBigDec()
UserError
- if this JsValue is not a JsBigDec or a JsDoubledefault boolean isLong(LongPredicate predicate)
predicate
- the given predicatedefault boolean isLong()
default JsLong toJsLong()
UserError
- if this JsValue is not a JsLong or a JsIntdefault boolean isPrimitive()
default boolean isJson()
default boolean isObj()
default boolean isArray()
default boolean isJson(Predicate<Json<?>> predicate)
predicate
- the given predicatedefault Json<?> toJson()
UserError
- if this JsValue is not a JsObj or a JsArraydefault JsObj toJsObj()
UserError
- if this JsValue is not a JsObjdefault JsArray toJsArray()
UserError
- if this JsValue is not a JsArraydefault boolean isObj(Predicate<JsObj> predicate)
predicate
- the given predicatedefault boolean isArray(Predicate<JsArray> predicate)
predicate
- the given predicatedefault JsNumber toJsNumber()
UserError
- if this JsValue is not a JsStrdefault boolean isBigInt(Predicate<BigInteger> predicate)
predicate
- the given predicatedefault boolean isBigInt()
default JsBigInt toJsBigInt()
UserError
- if this JsValue is not a JsBigInt or JsLong or JsIntdefault boolean isStr(Predicate<String> predicate)
predicate
- the given predicatedefault boolean isStr()
default JsStr toJsStr()
UserError
- if this JsValue is not a JsStrdefault boolean isIntegral()
default boolean isDecimal()
default boolean isNotNull()
default boolean isNull()
default boolean isNotNothing()
default boolean isNothing()
default boolean isNotNumber()
default boolean isNumber()
default JsValue ifNull(JsValue value)
value
- the default valueCopyright © 2022. All rights reserved.