Interface JsonObjectOrArray
- All Known Subinterfaces:
Form,JsonArray,JsonObject,SpincastXmlManager.JsonArrayMixIn,SpincastXmlManager.JsonObjectMixIn
- All Known Implementing Classes:
FormDefault,JsonArrayDefault,JsonObjectArrayBase,JsonObjectDefault,ValidationSetSimple
JsonObject and
JsonArray.-
Method Summary
Modifier and TypeMethodDescriptionclear()Clears all elements.clone(boolean mutable) Clone the object.booleanDoes the object contain an element at theJsonPathposition (even ifnull)?getArrayFirstBigDecimal(String jsonPath) Gets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstBigDecimal(String jsonPath, BigDecimal defaultElement) Gets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstBoolean(String jsonPath) Gets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstBoolean(String jsonPath, Boolean defaultElement) Gets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.byte[]getArrayFirstBytesFromBase64String(String jsonPath) Gets the first value (as byte[]) of aJsonArrayproperty of the object, using theJsonPathto find the array.byte[]getArrayFirstBytesFromBase64String(String jsonPath, byte[] defaultElement) Gets the first value (as byte[]) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstDate(String jsonPath) Gets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstDate(String jsonPath, Date defaultElement) Gets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstDouble(String jsonPath) Gets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstDouble(String jsonPath, Double defaultElement) Gets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstFloat(String jsonPath) Gets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstFloat(String jsonPath, Float defaultElement) Gets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstInstant(String jsonPath) Gets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstInstant(String jsonPath, Instant defaultElement) Gets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstInteger(String jsonPath) Gets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstInteger(String jsonPath, Integer defaultElement) Gets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstJsonArray(String jsonPath) Gets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstJsonArray(String jsonPath, JsonArray defaultElement) Gets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstJsonObject(String jsonPath) Gets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstJsonObject(String jsonPath, JsonObject defaultElement) Gets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstLong(String jsonPath) Gets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstLong(String jsonPath, Long defaultElement) Gets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstString(String jsonPath) Gets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstString(String jsonPath, String defaultElement) Gets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.getBigDecimal(String jsonPath) Gets an element asBigDecimalusing the specifiedJsonPath.getBigDecimal(String jsonPath, BigDecimal defaultElement) Gets an element asBigDecimalusing the specifiedJsonPath.getBoolean(String jsonPath) Gets an element asBooleanusing the specifiedJsonPath.getBoolean(String jsonPath, Boolean defaultElement) Gets an element asBooleanusing the specifiedJsonPath.byte[]getBytesFromBase64String(String jsonPath) Gets a byte array, from a base 64 encoded element using the specifiedJsonPath.byte[]getBytesFromBase64String(String jsonPath, byte[] defaultElement) Gets a byte array, from a base 64 encoded element using the specifiedJsonPath.Gets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.Gets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.Gets an element asDoubleusing the specifiedJsonPath.Gets an element asDoubleusing the specifiedJsonPath.Gets an element asFloatusing the specifiedJsonPath.Gets an element asFloatusing the specifiedJsonPath.getInstant(String jsonPath) Gets an Instant from aISO 8601date string element using the specifiedJsonPath.getInstant(String jsonPath, Instant defaultElement) Gets an Instant from aISO 8601date string element using the specifiedJsonPath.getInteger(String jsonPath) Gets an element asIntegerusing the specifiedJsonPath.getInteger(String jsonPath, Integer defaultElement) Gets an element asIntegerusing the specifiedJsonPath.getJsonArray(String jsonPath) Gets an element asJsonArrayusing the specifiedJsonPath.getJsonArray(String jsonPath, JsonArray defaultElement) Gets an element asJsonArrayusing the specifiedJsonPath.getJsonArrayOrEmpty(String jsonPath) Gets an element asJsonArrayusing the specifiedJsonPath.getJsonArrayOrEmpty(String jsonPath, boolean addIfDoesntExist) Gets an element asJsonArrayusing the specifiedJsonPath.getJsonObject(String jsonPath) Gets an element asJsonObjectusing the specifiedJsonPath.getJsonObject(String jsonPath, JsonObject defaultElement) Gets an element asJsonObjectusing the specifiedJsonPath.getJsonObjectOrEmpty(String jsonPath) Gets an element asJsonObjectusing the specifiedJsonPath.getJsonObjectOrEmpty(String jsonPath, boolean addIfDoesntExist) Gets an element asJsonObjectusing the specifiedJsonPath.Gets an element asLongusing the specifiedJsonPath.Gets an element asLongusing the specifiedJsonPath.Gets an untyped Object using the specifiedJsonPath.Gets an untyped Object using the specifiedJsonPath.Gets an element asStringusing the specifiedJsonPath.Gets an element asStringusing the specifiedJsonPath.booleanisCanBeConvertedToBigDecimal(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeBigDecimal, or can be converted and retrieved as one.booleanisCanBeConvertedToBoolean(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeBoolean, or can be converted and retrieved as one.booleanisCanBeConvertedToByteArray(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typebase 64 Stringrepresenting a byte array, or can be converted and retrieved as one.booleanisCanBeConvertedToDate(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeDate, or can be converted and retrieved as one.booleanisCanBeConvertedToDouble(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeDouble, or can be converted and retrieved as one.booleanisCanBeConvertedToFloat(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeFloat, or can be converted and retrieved as one.booleanisCanBeConvertedToInteger(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeInteger, or can be converted and retrieved as one.booleanisCanBeConvertedToJsonArray(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonArray, or can be converted and retrieved as one.booleanisCanBeConvertedToJsonObject(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonObject, or can be converted and retrieved as one.booleanisCanBeConvertedToLong(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeLong, or can be converted and retrieved as one.booleanisCanBeConvertedToString(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeString, or can be converted and retrieved as one.booleanIs this object/array mutable?booleanValidates that the value at the specifiedJsonPathexists and isnull.booleanisOfTypeBigDecimal(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeBigDecimal, without requiring any conversion.booleanisOfTypeBoolean(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeBoolean, without requiring any conversion.booleanisOfTypeByteArray(String jsonPath, boolean acceptBase64StringToo) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typebyte[], without requiring any conversion.booleanisOfTypeDate(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeDate, without requiring any conversion.booleanisOfTypeDouble(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeDouble, without requiring any conversion.booleanisOfTypeFloat(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeFloat, without requiring any conversion.booleanisOfTypeInteger(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeInteger, without requiring any conversion.booleanisOfTypeJsonArray(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonArray, without requiring any conversion.booleanisOfTypeJsonObject(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonObject, without requiring any conversion.booleanisOfTypeLong(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeLong, without requiring any conversion.booleanisOfTypeString(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeString, without requiring any conversion.booleanDoes the object contain an element at theJsonPathposition (even ifnull)?Removes an element atJsonPath.Sets an element at the specifiedJsonPath.Sets an element at the specifiedJsonPath.setIfAbsent(String jsonPath, Object element) Sets an element at the specifiedJsonPathif no element exists at this path.setIfAbsent(String jsonPath, Object element, boolean clone) Sets an element at the specifiedJsonPathif no element exists at this path.intsize()The size of the object.TheJsonstring representation of the object.toJsonString(boolean pretty) TheJsonstring representation of the object.voidtransform(String jsonPath, ElementTransformer transformer) Transforms the element at the specifiedJsonPathusing the transformer.voidtransformAll(ElementTransformer transformer) Transforms all the elements of the object, using the specified transformer.voidtransformAll(ElementTransformer transformer, boolean recursive) Transforms all the elements of the object, using the specified transformer.voidTrims the element at the specifiedJsonPathif it's of typeString.voidtrimAll()Trims all the elements of the object that are of typeString.voidtrimAll(boolean recursive) Trims all the elements of the object that are of type String.
-
Method Details
-
transform
Transforms the element at the specifiedJsonPathusing the transformer. -
isMutable
boolean isMutable()Is this object/array mutable? -
clear
JsonObjectOrArray clear()Clears all elements. -
size
int size()The size of the object. -
toJsonString
String toJsonString()TheJsonstring representation of the object. -
toJsonString
TheJsonstring representation of the object.- Parameters:
pretty- iftrue, the generated String will be formatted.
-
clone
Clone the object.- Parameters:
mutable- iffalse, the resulting object will be immutable.
-
transformAll
Transforms all the elements of the object, using the specified transformer. This transformation is not recursive. -
transformAll
Transforms all the elements of the object, using the specified transformer.- Parameters:
recursive- iftrue, then all children elements will also be transformed, recursively.
-
trim
Trims the element at the specifiedJsonPathif it's of typeString. -
trimAll
void trimAll()Trims all the elements of the object that are of typeString. This transformation is not recursive. -
trimAll
void trimAll(boolean recursive) Trims all the elements of the object that are of type String.- Parameters:
recursive- iftrue, then all children elements will also be trimmed, recursively.
-
contains
Does the object contain an element at theJsonPathposition (even ifnull)?Same as
isPresent(String). -
isPresent
Does the object contain an element at theJsonPathposition (even ifnull)?Same as
contains(String). -
remove
Removes an element atJsonPath.- Returns:
- the current object (fluent style).
-
set
Sets an element at the specifiedJsonPath. Overwrites any existing element at thatJsonPath.The required hierarchy will be created, if required, to support the
JsonPath.If the object to add is not of a JsonObject's native type, the object is converted to a JsonObject or a JsonArray before being added. Once the object is converted and added, a modification to the original object won't affect the added element, and vice-versa.
If the element to add is a
JsonObjector aJsonArrayand is immutable then it will be cloned. Doing so, we can make sure that the current object is always fully mutable or fully immutable.If the element implements
ToJsonObjectConvertible, it will be converted to aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing the associated conversion method.Those are the types of object that will be converted to a JsonArray instead of a JsonObject, if no conversion interface is implemented :
- A Collection
- An array
-
set
Sets an element at the specifiedJsonPath. Overwrites any existing element at thatJsonPath.The required hierarchy will be created, if required, to support the
JsonPath.If the object to add is not of a JsonObject's native type, the object is converted to a JsonObject or a JsonArray before being added. Once the object is converted and added, a modification to the original object won't affect the added element, and vice-versa.
If the element to add is a
JsonObjector aJsonArrayand is immutable then it will be cloned. Doing so, we can make sure that the current object is always fully mutable or fully immutable.If the element implements
ToJsonObjectConvertible, it will be converted to aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing the associated conversion method.Those are the types of object that will be converted to a JsonArray instead of a JsonObject, if no conversion interface is implemented :
- A Collection
- An array
- Parameters:
clone- iftrue, and the element to add is aJsonObjectorJsonArray, a clone will be made before being added. If that case, any modification to the original element won't affect the added one, and vice-versa. If the element is immutable then it will always be cloned. Doing so, we can make sure the current object is always fully mutable or fully immutable.
-
setIfAbsent
Sets an element at the specifiedJsonPathif no element exists at this path.The required hierarchy will be created, if required, to support the
JsonPath.If the object to add is not of a JsonObject's native type, the object is converted to a JsonObject or a JsonArray before being added. Once the object is converted and added, a modification to the original object won't affect the added element, and vice-versa.
If the element to add is a
JsonObjector aJsonArrayand is immutable then it will be cloned. Doing so, we can make sure that the current object is always fully mutable or fully immutable.If the element implements
ToJsonObjectConvertible, it will be converted to aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing the associated conversion method.Those are the types of object that will be converted to a JsonArray instead of a JsonObject, if no conversion interface is implemented :
- A Collection
- An array
-
setIfAbsent
Sets an element at the specifiedJsonPathif no element exists at this path.The required hierarchy will be created, if required, to support the
JsonPath.If the object to add is not of a JsonObject's native type, the object is converted to a JsonObject or a JsonArray before being added. Once the object is converted and added, a modification to the original object won't affect the added element, and vice-versa.
If the element to add is a
JsonObjector aJsonArrayand is immutable then it will be cloned. Doing so, we can make sure that the current object is always fully mutable or fully immutable.If the element implements
ToJsonObjectConvertible, it will be converted to aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing the associated conversion method.Those are the types of object that will be converted to a JsonArray instead of a JsonObject, if no conversion interface is implemented :
- A Collection
- An array
- Parameters:
clone- iftrue, and the element to add is aJsonObjectorJsonArray, a clone will be made before being added. If that case, any modification to the original element won't affect the added one, and vice-versa. If the element is immutable then it will always be cloned. Doing so, we can make sure the current object is always fully mutable or fully immutable.
-
getJsonObject
Gets an element asJsonObjectusing the specifiedJsonPath.- Returns:
- the object or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getJsonObject
Gets an element asJsonObjectusing the specifiedJsonPath.- Returns:
- the object or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getJsonObjectOrEmpty
Gets an element asJsonObjectusing the specifiedJsonPath.- Returns:
- the element or an empty
JsonObjectif not found or ifnull. The emptyJsonObjectwill not be added to the specified path. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getJsonObjectOrEmpty
JsonObject getJsonObjectOrEmpty(String jsonPath, boolean addIfDoesntExist) throws CantConvertException Gets an element asJsonObjectusing the specifiedJsonPath.- Parameters:
addIfDoesntExist- iftrueand the element doesn't exist, the created emptyJsonObjectwill be added to the specifiedJsonPath.- Returns:
- the element or an empty
JsonObjectif not found or ifnull. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getJsonArray
Gets an element asJsonArrayusing the specifiedJsonPath.- Returns:
- the object or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getJsonArray
Gets an element asJsonArrayusing the specifiedJsonPath.- Returns:
- the object or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getJsonArrayOrEmpty
Gets an element asJsonArrayusing the specifiedJsonPath.- Returns:
- the element or an empty
JsonArrayif not found or ifnull. The emptyJsonArraywill not be added to the specified path. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getJsonArrayOrEmpty
JsonArray getJsonArrayOrEmpty(String jsonPath, boolean addIfDoesntExist) throws CantConvertException Gets an element asJsonArrayusing the specifiedJsonPath.- Parameters:
addIfDoesntExist- iftrueand the element doesn't exist, the created emptyJsonArraywill be added to the specifiedJsonPath.- Returns:
- the element or an empty
JsonArrayif not found or ifnull. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getString
Gets an element asStringusing the specifiedJsonPath.- Returns:
- the element or
nullif not found.
-
getString
Gets an element asStringusing the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found.
-
getInteger
Gets an element asIntegerusing the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getInteger
Gets an element asIntegerusing the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getLong
Gets an element asLongusing the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getLong
Gets an element asLongusing the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getFloat
Gets an element asFloatusing the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getFloat
Gets an element asFloatusing the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getDouble
Gets an element asDoubleusing the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getDouble
Gets an element asDoubleusing the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getBoolean
Gets an element asBooleanusing the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getBoolean
Gets an element asBooleanusing the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getBigDecimal
Gets an element asBigDecimalusing the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getBigDecimal
Gets an element asBigDecimalusing the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getBytesFromBase64String
Gets a byte array, from a base 64 encoded element using the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getBytesFromBase64String
Gets a byte array, from a base 64 encoded element using the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getDate
Gets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getDate
Gets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getInstant
Gets an Instant from aISO 8601date string element using the specifiedJsonPath.- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getInstant
Gets an Instant from aISO 8601date string element using the specifiedJsonPath.- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getObject
Gets an untyped Object using the specifiedJsonPath.- Returns:
- the object or
nullif not found. This object will necessarily be of a type managed byJsonObjectOrArray, since an object of any other type is automatically converted when added.
-
getObject
Gets an untyped Object using the specifiedJsonPath.- Returns:
- the object or the specified
defaultElementif not found. This object will necessarily be of a type managed byJsonObjectOrArray, since an object of any other type is automatically converted when added.
-
getArrayFirstJsonObject
Gets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstJsonObject
JsonObject getArrayFirstJsonObject(String jsonPath, JsonObject defaultElement) throws CantConvertException Gets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstJsonArray
Gets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstJsonArray
JsonArray getArrayFirstJsonArray(String jsonPath, JsonArray defaultElement) throws CantConvertException Gets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstString
Gets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstString
Gets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstInteger
Gets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstInteger
Gets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstLong
Gets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstLong
Gets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstDouble
Gets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstDouble
Gets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstFloat
Gets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstFloat
Gets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstBoolean
Gets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstBoolean
Gets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstBigDecimal
Gets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstBigDecimal
BigDecimal getArrayFirstBigDecimal(String jsonPath, BigDecimal defaultElement) throws CantConvertException Gets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstBytesFromBase64String
Gets the first value (as byte[]) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstBytesFromBase64String
byte[] getArrayFirstBytesFromBase64String(String jsonPath, byte[] defaultElement) throws CantConvertException Gets the first value (as byte[]) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstDate
Gets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstDate
Gets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstInstant
Gets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or
nullif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getArrayFirstInstant
Gets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
isCanBeConvertedToString
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeString, or can be converted and retrieved as one. -
isCanBeConvertedToInteger
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeInteger, or can be converted and retrieved as one. -
isCanBeConvertedToLong
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeLong, or can be converted and retrieved as one. -
isCanBeConvertedToFloat
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeFloat, or can be converted and retrieved as one. -
isCanBeConvertedToDouble
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeDouble, or can be converted and retrieved as one. -
isCanBeConvertedToBoolean
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeBoolean, or can be converted and retrieved as one. -
isCanBeConvertedToBigDecimal
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeBigDecimal, or can be converted and retrieved as one. -
isCanBeConvertedToByteArray
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typebase 64 Stringrepresenting a byte array, or can be converted and retrieved as one. -
isCanBeConvertedToDate
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeDate, or can be converted and retrieved as one. -
isCanBeConvertedToJsonObject
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonObject, or can be converted and retrieved as one. -
isCanBeConvertedToJsonArray
Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonArray, or can be converted and retrieved as one. -
isOfTypeString
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeString, without requiring any conversion. -
isOfTypeInteger
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeInteger, without requiring any conversion. -
isOfTypeLong
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeLong, without requiring any conversion. -
isOfTypeFloat
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeFloat, without requiring any conversion. -
isOfTypeDouble
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeDouble, without requiring any conversion. -
isOfTypeBoolean
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeBoolean, without requiring any conversion. -
isOfTypeBigDecimal
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeBigDecimal, without requiring any conversion. -
isOfTypeByteArray
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typebyte[], without requiring any conversion.- Parameters:
acceptBase64StringToo- iftrue, then a valid base 64 String will also be accepted.
-
isOfTypeDate
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeDate, without requiring any conversion. -
isOfTypeJsonObject
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonObject, without requiring any conversion. -
isOfTypeJsonArray
Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonArray, without requiring any conversion. -
isNull
Validates that the value at the specifiedJsonPathexists and isnull.
-