public interface JsonObject extends JsonObjectOrArray, Iterable<Map.Entry<String,Object>>
Json object, "{}".| Modifier and Type | Method and Description |
|---|---|
JsonObject |
clone(boolean mutable)
Deep copy of the
JsonObject, so any
modification to the original won't affect the
clone, and vice-versa. |
<T> T |
convert(Class<T> clazz)
Converts the
JsonObject to an instance of
the specified T type. |
Map<String,Object> |
convertToPlainMap()
Converts the
JsonObject to a plain Map. |
BigDecimal |
getArrayFirstBigDecimalNoKeyParsing(String key)
Gets the first value (as BigDecimal) of a
JsonArray element
. |
BigDecimal |
getArrayFirstBigDecimalNoKeyParsing(String key,
BigDecimal defaultElement)
Gets the first value (as BigDecimal) of a
JsonArray element
. |
Boolean |
getArrayFirstBooleanNoKeyParsing(String key)
Gets the first value (as Boolean) of a
JsonArray element
. |
Boolean |
getArrayFirstBooleanNoKeyParsing(String key,
Boolean defaultElement)
Gets the first value (as Boolean) of a
JsonArray element
. |
byte[] |
getArrayFirstBytesFromBase64StringNoKeyParsing(String key)
Gets the first value (as byte[]) of a
JsonArray element
. |
byte[] |
getArrayFirstBytesFromBase64StringNoKeyParsing(String key,
byte[] defaultElement)
Gets the first value (as byte[]) of a
JsonArray element
. |
Date |
getArrayFirstDateNoKeyParsing(String key)
Gets the first value (as Date) of a
JsonArray element
. |
Date |
getArrayFirstDateNoKeyParsing(String key,
Date defaultElement)
Gets the first value (as Date) of a
JsonArray element. |
Double |
getArrayFirstDoubleNoKeyParsing(String key)
Gets the first value (as Double) of a
JsonArray element
. |
Double |
getArrayFirstDoubleNoKeyParsing(String key,
Double defaultElement)
Gets the first value (as Double) of a
JsonArray element
. |
Float |
getArrayFirstFloatNoKeyParsing(String key)
Gets the first value (as Float) of a
JsonArray element
. |
Float |
getArrayFirstFloatNoKeyParsing(String key,
Float defaultElement)
Gets the first value (as Float) of a
JsonArray element
. |
Integer |
getArrayFirstIntegerNoKeyParsing(String key)
Gets the first value (as Integer) of a
JsonArray element
. |
Integer |
getArrayFirstIntegerNoKeyParsing(String key,
Integer defaultElement)
Gets the first value (as Integer) of a
JsonArray element
. |
JsonArray |
getArrayFirstJsonArrayNoKeyParsing(String key)
Gets the first value (as JsonArray) of a
JsonArray element
. |
JsonArray |
getArrayFirstJsonArrayNoKeyParsing(String key,
JsonArray defaultElement)
Gets the first value (as JsonArray) of a
JsonArray element
. |
JsonObject |
getArrayFirstJsonObjectNoKeyParsing(String key)
Gets the first value (as JsonObject) of a
JsonArray element
. |
JsonObject |
getArrayFirstJsonObjectNoKeyParsing(String key,
JsonObject defaultElement)
Gets the first value (as JsonObject) of a
JsonArray element
. |
Long |
getArrayFirstLongNoKeyParsing(String key)
Gets the first value (as Long) of a
JsonArray element
. |
Long |
getArrayFirstLongNoKeyParsing(String key,
Long defaultElement)
Gets the first value (as Long) of a
JsonArray element
. |
String |
getArrayFirstStringNoKeyParsing(String key)
Gets the first value (as String) of a
JsonArray element
. |
String |
getArrayFirstStringNoKeyParsing(String key,
String defaultElement)
Gets the first value (as String) of a
JsonArray element
. |
BigDecimal |
getBigDecimalNoKeyParsing(String key)
Gets an element as
BigDecimal. |
BigDecimal |
getBigDecimalNoKeyParsing(String key,
BigDecimal defaultElement)
Gets an element as
BigDecimal. |
Boolean |
getBooleanNoKeyParsing(String key)
Gets an element as
Boolean. |
Boolean |
getBooleanNoKeyParsing(String key,
Boolean defaultElement)
Gets an element as
Boolean. |
byte[] |
getBytesFromBase64StringNoKeyParsing(String key)
Gets a byte array, from a base 64 encoded element.
|
byte[] |
getBytesFromBase64StringNoKeyParsing(String key,
byte[] defaultElement)
Gets a byte array, from a base 64 encoded element.
|
Date |
getDateNoKeyParsing(String key)
Gets a UTC timezoned date from a
ISO 8601 date element. |
Date |
getDateNoKeyParsing(String key,
Date defaultElement)
Gets a UTC timezoned date from a
ISO 8601 date element. |
Double |
getDoubleNoKeyParsing(String jsonPath)
Gets an element as
Double. |
Double |
getDoubleNoKeyParsing(String jsonPath,
Double defaultElement)
Gets an element as
Double. |
Float |
getFloatNoKeyParsing(String jsonPath)
Gets an element as
Float. |
Float |
getFloatNoKeyParsing(String jsonPath,
Float defaultElement)
Gets an element as
Float. |
Instant |
getInstantNoKeyParsing(String key)
Gets an Instant from a
ISO 8601 date element. |
Instant |
getInstantNoKeyParsing(String key,
Instant defaultElement)
Gets an Instant from a
ISO 8601 date element. |
Integer |
getIntegerNoKeyParsing(String jsonPath)
Gets an element as
Integer. |
Integer |
getIntegerNoKeyParsing(String jsonPath,
Integer defaultElement)
Gets an element as
Integer. |
JsonArray |
getJsonArrayNoKeyParsing(String jsonPath)
Gets an element as
JsonArray. |
JsonArray |
getJsonArrayNoKeyParsing(String jsonPath,
JsonArray defaultElement)
Gets an element as
JsonArray. |
JsonArray |
getJsonArrayOrEmptyNoKeyParsing(String jsonPath)
Gets an element as
JsonArray. |
JsonObject |
getJsonObjectNoKeyParsing(String jsonPath)
Gets an element as
JsonObject. |
JsonObject |
getJsonObjectNoKeyParsing(String jsonPath,
JsonObject defaultElement)
Gets an element as
JsonObject. |
JsonObject |
getJsonObjectOrEmptyNoKeyParsing(String jsonPath)
Gets an element as
JsonObject. |
Long |
getLongNoKeyParsing(String jsonPath)
Gets an element as
Long. |
Long |
getLongNoKeyParsing(String jsonPath,
Long defaultElement)
Gets an element as
Long. |
Object |
getObjectNoKeyParsing(String jsonPath)
Gets an untyped Object.
|
Object |
getObjectNoKeyParsing(String jsonPath,
Object defaultElement)
Gets an untyped Object.
|
String |
getStringNoKeyParsing(String jsonPath)
Gets an element as
String. |
String |
getStringNoKeyParsing(String jsonPath,
String defaultElement)
Gets an element as
String. |
boolean |
isCanBeConvertedToBigDecimalNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type BigDecimal, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToBooleanNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type Boolean, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToByteArrayNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type base 64 String representing
a byte array, or can be converted and retrieved as one. |
boolean |
isCanBeConvertedToDateNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type Date, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToDoubleNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type Double, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToFloatNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type Float, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToIntegerNoKeyParsing(String key)
Validates that the element at the specifiedkey (not parsed
as a
JsonPath) exists and
is currently null, of type Integer, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToJsonArrayNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type JsonArray, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToJsonObjectNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type JsonObject, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToLongNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type Long, or can be
converted and retrieved as one. |
boolean |
isCanBeConvertedToStringNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null, of type String, or can be
converted and retrieved as one. |
boolean |
isElementExistsNoKeyParsing(String key)
Does the JsonObject contain an element at
the specified key?
The key is considered as is, without
being parsed as a
JsonPath. |
boolean |
isEquivalentTo(JsonObject other)
Compares the current
JsonObject to the specified one
and returns true if they are equivalent. |
boolean |
isNullNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is null. |
boolean |
isOfTypeBigDecimalNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type BigDecimal, without requiring
any conversion. |
boolean |
isOfTypeBooleanNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath)> exists and
is currently null or of type Boolean, without requiring
any conversion. |
boolean |
isOfTypeByteArrayNoKeyParsing(String key,
boolean acceptBase64StringToo)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type byte[], without requiring
any conversion. |
boolean |
isOfTypeDateNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type Date, without requiring
any conversion. |
boolean |
isOfTypeDoubleNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type Double, without requiring
any conversion. |
boolean |
isOfTypeFloatNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type Float, without requiring
any conversion. |
boolean |
isOfTypeIntegerNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type Integer, without requiring
any conversion. |
boolean |
isOfTypeJsonArrayNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type JsonArray, without requiring
any conversion. |
boolean |
isOfTypeJsonObjectNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type JsonObject, without requiring
any conversion. |
boolean |
isOfTypeLongNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type Long, without requiring
any conversion. |
boolean |
isOfTypeStringNoKeyParsing(String key)
Validates that the element at the specified key (not parsed
as a
JsonPath) exists and
is currently null or of type String, without requiring
any conversion. |
JsonObject |
merge(JsonObject jsonObj)
Merges the specified
JsonObject properties in the current
object. |
JsonObject |
merge(JsonObject jsonObj,
boolean clone)
Merges the specified
JsonObject properties in the current
object. |
JsonObject |
merge(Map<String,?> map)
Merges all the specified Map elements in the JsonObject.
|
JsonObject |
merge(Map<String,?> map,
boolean clone)
Merges all the specified Map elements in the JsonObject.
|
JsonObject |
merge(ToJsonObjectConvertible jsonObj)
Transforms the specifie3d object to
JsonObject
and merges its properties in the current
object. |
JsonObject |
putNoKeyParsing(String key,
Object element)
Puts an element at the specified key, without parsing this
key as a
JsonPath. |
JsonObject |
putNoKeyParsing(String key,
Object element,
boolean clone)
Puts an element at the specified key, without parsing this
key as a
JsonPath. |
JsonObject |
removeNoKeyParsing(String key)
Removes a element from the object.
|
clear, getArrayFirstBigDecimal, getArrayFirstBigDecimal, getArrayFirstBoolean, getArrayFirstBoolean, getArrayFirstBytesFromBase64String, getArrayFirstBytesFromBase64String, getArrayFirstDate, getArrayFirstDate, getArrayFirstDouble, getArrayFirstDouble, getArrayFirstFloat, getArrayFirstFloat, getArrayFirstInstant, getArrayFirstInstant, getArrayFirstInteger, getArrayFirstInteger, getArrayFirstJsonArray, getArrayFirstJsonArray, getArrayFirstJsonObject, getArrayFirstJsonObject, getArrayFirstLong, getArrayFirstLong, getArrayFirstString, getArrayFirstString, getBigDecimal, getBigDecimal, getBoolean, getBoolean, getBytesFromBase64String, getBytesFromBase64String, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInstant, getInstant, getInteger, getInteger, getJsonArray, getJsonArray, getJsonArrayOrEmpty, getJsonArrayOrEmpty, getJsonObject, getJsonObject, getJsonObjectOrEmpty, getJsonObjectOrEmpty, getLong, getLong, getObject, getObject, getString, getString, isCanBeConvertedToBigDecimal, isCanBeConvertedToBoolean, isCanBeConvertedToByteArray, isCanBeConvertedToDate, isCanBeConvertedToDouble, isCanBeConvertedToFloat, isCanBeConvertedToInteger, isCanBeConvertedToJsonArray, isCanBeConvertedToJsonObject, isCanBeConvertedToLong, isCanBeConvertedToString, isElementExists, isMutable, isNull, isOfTypeBigDecimal, isOfTypeBoolean, isOfTypeByteArray, isOfTypeDate, isOfTypeDouble, isOfTypeFloat, isOfTypeInteger, isOfTypeJsonArray, isOfTypeJsonObject, isOfTypeLong, isOfTypeString, put, put, remove, size, toJsonString, toJsonString, transform, transformAll, transformAll, trim, trimAll, trimAllforEach, iterator, spliteratorJsonObject putNoKeyParsing(String key, Object element)
JsonPath.
If the element to add is not of a native type, then the element is converted before being added. Once the element is converted and added, a modification of the original object won't affect this element, and vice-versa.
If the element to add is a JsonObject or
a JsonArray and is immutable, it will be cloned.
Doing so, we can make sure the JsonArray is always
fully mutable or fully immutable.
If the element implements ToJsonObjectConvertible, it
will be converted to a JsonObject using the associated
conversion method. If it implements ToJsonArrayConvertible, it
will be converted to an JsonArray using the associated
conversion method.
Those are the types of objects that will be converted to a
JsonArray instead of a JsonObject, if
no conversion interface is implemented :
JsonObject putNoKeyParsing(String key, Object element, boolean clone)
JsonPath.
If the element to add is not of a native type, then the element is converted before being added. Once the element is converted and added, a modification of the original object won't affect this element, and vice-versa.
If the element to add is a JsonObject or
a JsonArray and is immutable, it will be cloned.
Doing so, we can make sure the JsonArray is always
fully mutable or fully immutable.
If the element implements ToJsonObjectConvertible, it
will be converted to a JsonObject using the associated
conversion method. If it implements ToJsonArrayConvertible, it
will be converted to an JsonArray using the associated
conversion method.
Those are the types of objects that will be converted to a
JsonArray instead of a JsonObject, if
no conversion interface is implemented :
clone - if true, and the element to add is a
JsonObject or JsonArray, 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 a
JsonObject is always
fully mutable or fully immutable.JsonObject merge(Map<String,?> map)
JsonPaths.
Overwrites existing elements at the specified JsonPaths.
Note that the JsonObject and JsonArray objects from the source
will be added as is, so any modification to them WILL affect
the added elements, and vise-versa. There is an exception though :
if the element to add is immutable
then it will always be cloned. Doing so, we can make sure a
JsonObject is always
fully mutable or fully immutable.
If an element to is not of a native type, then the element is converted before being added. Once the element is converted and added, a modification of the original object won't affect this element, and vice-versa.
If an element to is a JsonObject or
a JsonArray and is immutable, it will be cloned.
Doing so, we can make sure the JsonArray is always
fully mutable or fully immutable.
If an element implements ToJsonObjectConvertible, it
will be converted to a JsonObject using the associated
conversion method. If it implements ToJsonArrayConvertible, it
will be converted to an JsonArray using the associated
conversion method.
Those are the types of objects that will be converted to a
JsonArray instead of a JsonObject, if
no conversion interface is implemented :
JsonObject merge(Map<String,?> map, boolean clone)
JsonPaths.
Overwrites existing elements at the specified JsonPaths.
If an element to is not of a native type, then the element is converted before being added. Once the element is converted and added, a modification of the original object won't affect this element, and vice-versa.
If an element to is a JsonObject or
a JsonArray and is immutable, it will be cloned.
Doing so, we can make sure the JsonArray is always
fully mutable or fully immutable.
If an element implements ToJsonObjectConvertible, it
will be converted to a JsonObject using the associated
conversion method. If it implements ToJsonArrayConvertible, it
will be converted to an JsonArray using the associated
conversion method.
Those are the types of objects that will be converted to a
JsonArray instead of a JsonObject, if
no conversion interface is implemented :
clone - if true, a clone of any
JsonObject or JsonArray will be made
before being added. If that case, any modification to the
original elements won't affect the added elements,
and vice-versa. If the element is immutable then it will
always be cloned. Doing so, we can make sure a
JsonObject is always
fully mutable or fully immutable.JsonObject merge(JsonObject jsonObj)
JsonObject properties in the current
object. Overwrites elements of the same JsonPaths.
Note that the elements from the source are added as is,
so any modification to them WILL affect the added element,
and vise-versa. There is an exception though :
if an element to add is immutable
then it will always be cloned. Doing so, we can make sure a
JsonObject is always
fully mutable or fully immutable.
JsonObject merge(JsonObject jsonObj, boolean clone)
JsonObject properties in the current
object. Overwrites elements of the same JsonPaths.clone - if true, a clone of the original
JsonObject will be made before being added.
If that case, any modification to the original object
won't affect the added element, and vice-versa.
If an element is immutable then it will
always be cloned. Doing so, we can make sure a
JsonObject is always
fully mutable or fully immutable.JsonObject merge(ToJsonObjectConvertible jsonObj)
JsonObject
and merges its properties in the current
object. Overwrites elements of the same JsonPaths.JsonObject removeNoKeyParsing(String key)
JsonPath.boolean isElementExistsNoKeyParsing(String key)
JsonPath.Object getObjectNoKeyParsing(String jsonPath)
null if not found. This object
will inevitably be of a type managed by JsonObject, since
an object of any other type is automatically converted when added.Object getObjectNoKeyParsing(String jsonPath, Object defaultElement)
defaultElement if not found. This object
will inevitably be of a type managed by JsonObject, since
an object of any other type is automatically converted when added.JsonObject getJsonObjectNoKeyParsing(String jsonPath) throws CantConvertException
JsonObject.null if not found.CantConvertException - if an existing element can't be converted to the
required type.JsonObject getJsonObjectNoKeyParsing(String jsonPath, JsonObject defaultElement) throws CantConvertException
JsonObject.defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.JsonObject getJsonObjectOrEmptyNoKeyParsing(String jsonPath) throws CantConvertException
JsonObject.JsonObject if not found or if null.CantConvertException - if an existing element can't be converted to the
required type.JsonArray getJsonArrayNoKeyParsing(String jsonPath) throws CantConvertException
JsonArray.null if not found.CantConvertException - if an existing element can't be converted to the
required type.JsonArray getJsonArrayNoKeyParsing(String jsonPath, JsonArray defaultElement) throws CantConvertException
JsonArray.defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.JsonArray getJsonArrayOrEmptyNoKeyParsing(String jsonPath) throws CantConvertException
JsonArray.JsonArray if not found or if null.CantConvertException - if an existing element can't be converted to the
required type.String getStringNoKeyParsing(String jsonPath)
String.null if not found.String getStringNoKeyParsing(String jsonPath, String defaultElement)
String.defaultElement if not found.Integer getIntegerNoKeyParsing(String jsonPath) throws CantConvertException
Integer.null if not found.CantConvertException - if an existing element can't be converted to the
required type.Integer getIntegerNoKeyParsing(String jsonPath, Integer defaultElement) throws CantConvertException
Integer.defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.Long getLongNoKeyParsing(String jsonPath) throws CantConvertException
Long.null if not found.CantConvertException - if an existing element can't be converted to the
required type.Long getLongNoKeyParsing(String jsonPath, Long defaultElement) throws CantConvertException
Long.defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.Float getFloatNoKeyParsing(String jsonPath) throws CantConvertException
Float.null if not found.CantConvertException - if an existing element can't be converted to the
required type.Float getFloatNoKeyParsing(String jsonPath, Float defaultElement) throws CantConvertException
Float.defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.Double getDoubleNoKeyParsing(String jsonPath) throws CantConvertException
Double.null if not found.CantConvertException - if an existing element can't be converted to the
required type.Double getDoubleNoKeyParsing(String jsonPath, Double defaultElement) throws CantConvertException
Double.defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.Boolean getBooleanNoKeyParsing(String key) throws CantConvertException
Boolean.
The key will be used as is, it won't be parsed
as a JsonPath.
The signature of this method is different than from the other "get" methods with a "parseJsonPath" parameter since we have to differenciate it from the overload that takes a Boolean default value.
null if not found.CantConvertException - if an existing element can't be converted to the
required type.Boolean getBooleanNoKeyParsing(String key, Boolean defaultElement) throws CantConvertException
Boolean.
The key will be used as is, it won't be parsed
as a JsonPath.
defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.BigDecimal getBigDecimalNoKeyParsing(String key) throws CantConvertException
BigDecimal.
The key will be used as is, it won't be parsed
as a JsonPath.
null if not found.CantConvertException - if an existing element can't be converted to the
required type.BigDecimal getBigDecimalNoKeyParsing(String key, BigDecimal defaultElement) throws CantConvertException
BigDecimal.
The key will be used as is, it won't be parsed
as a JsonPath.
defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.byte[] getBytesFromBase64StringNoKeyParsing(String key) throws CantConvertException
The key will be used as is, it won't be parsed
as a JsonPath.
null if not found.CantConvertException - if an existing element can't be converted to the
required type.byte[] getBytesFromBase64StringNoKeyParsing(String key, byte[] defaultElement) throws CantConvertException
The key will be used as is, it won't be parsed
as a JsonPath.
defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.Date getDateNoKeyParsing(String key) throws CantConvertException
ISO 8601 date element.
The key will be used as is, it won't be parsed
as a JsonPath.
null if not found.CantConvertException - if an existing element can't be converted to the
required type.Date getDateNoKeyParsing(String key, Date defaultElement) throws CantConvertException
ISO 8601 date element.
The key will be used as is, it won't be parsed
as a JsonPath.
defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.Instant getInstantNoKeyParsing(String key) throws CantConvertException
ISO 8601 date element.
The key will be used as is, it won't be parsed
as a JsonPath.
null if not found.CantConvertException - if an existing element can't be converted to the
required type.Instant getInstantNoKeyParsing(String key, Instant defaultElement) throws CantConvertException
ISO 8601 date element.
The key will be used as is, it won't be parsed
as a JsonPath.
defaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.JsonObject getArrayFirstJsonObjectNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.JsonObject getArrayFirstJsonObjectNoKeyParsing(String key, JsonObject defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.JsonArray getArrayFirstJsonArrayNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.JsonArray getArrayFirstJsonArrayNoKeyParsing(String key, JsonArray defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.String getArrayFirstStringNoKeyParsing(String key)
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.String getArrayFirstStringNoKeyParsing(String key, String defaultElement)
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.Integer getArrayFirstIntegerNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Integer getArrayFirstIntegerNoKeyParsing(String key, Integer defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the arr
ay or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Long getArrayFirstLongNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Long getArrayFirstLongNoKeyParsing(String key, Long defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Double getArrayFirstDoubleNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Double getArrayFirstDoubleNoKeyParsing(String key, Double defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Float getArrayFirstFloatNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Float getArrayFirstFloatNoKeyParsing(String key, Float defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Boolean getArrayFirstBooleanNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Boolean getArrayFirstBooleanNoKeyParsing(String key, Boolean defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.BigDecimal getArrayFirstBigDecimalNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.BigDecimal getArrayFirstBigDecimalNoKeyParsing(String key, BigDecimal defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.byte[] getArrayFirstBytesFromBase64StringNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.byte[] getArrayFirstBytesFromBase64StringNoKeyParsing(String key, byte[] defaultElement) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Date getArrayFirstDateNoKeyParsing(String key) throws CantConvertException
JsonArray element
. The key will be used as is without being parsed
as a JsonPath.null if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.Date getArrayFirstDateNoKeyParsing(String key, Date defaultElement) throws CantConvertException
JsonArray element.
The key will be used as is without being parsed
as a JsonPath.defaultElement if the array or
the first element are not found.CantConvertException - if an existing element can't be converted to the
required type.<T> T convert(Class<T> clazz)
JsonObject to an instance of
the specified T type.
This uses JsonManager#fromJsonString
and may throw an exception if it is unable to do the conversion.
Map<String,Object> convertToPlainMap()
JsonObject to a plain Map.
All JsonObject children will be converted to
Maps and all JsonArray children will be converted to
Lists.boolean isCanBeConvertedToStringNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type String, or can be
converted and retrieved as one.boolean isCanBeConvertedToIntegerNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type Integer, or can be
converted and retrieved as one.boolean isCanBeConvertedToLongNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type Long, or can be
converted and retrieved as one.boolean isCanBeConvertedToFloatNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type Float, or can be
converted and retrieved as one.boolean isCanBeConvertedToDoubleNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type Double, or can be
converted and retrieved as one.boolean isCanBeConvertedToBooleanNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type Boolean, or can be
converted and retrieved as one.boolean isCanBeConvertedToBigDecimalNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type BigDecimal, or can be
converted and retrieved as one.boolean isCanBeConvertedToByteArrayNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type base 64 String representing
a byte array, or can be converted and retrieved as one.boolean isCanBeConvertedToDateNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type Date, or can be
converted and retrieved as one.boolean isCanBeConvertedToJsonObjectNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type JsonObject, or can be
converted and retrieved as one.boolean isCanBeConvertedToJsonArrayNoKeyParsing(String key)
JsonPath) exists and
is currently null, of type JsonArray, or can be
converted and retrieved as one.boolean isOfTypeStringNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type String, without requiring
any conversion.boolean isOfTypeIntegerNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type Integer, without requiring
any conversion.boolean isOfTypeLongNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type Long, without requiring
any conversion.boolean isOfTypeFloatNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type Float, without requiring
any conversion.boolean isOfTypeDoubleNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type Double, without requiring
any conversion.boolean isOfTypeBooleanNoKeyParsing(String key)
JsonPath)> exists and
is currently null or of type Boolean, without requiring
any conversion.boolean isOfTypeBigDecimalNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type BigDecimal, without requiring
any conversion.boolean isOfTypeByteArrayNoKeyParsing(String key, boolean acceptBase64StringToo)
JsonPath) exists and
is currently null or of type byte[], without requiring
any conversion.acceptBase64StringToo - if true, then a valid base 64 String
will also be accepted.boolean isOfTypeDateNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type Date, without requiring
any conversion.boolean isOfTypeJsonObjectNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type JsonObject, without requiring
any conversion.boolean isOfTypeJsonArrayNoKeyParsing(String key)
JsonPath) exists and
is currently null or of type JsonArray, without requiring
any conversion.boolean isNullNoKeyParsing(String key)
JsonPath) exists and
is null.boolean isEquivalentTo(JsonObject other)
JsonObject to the specified one
and returns true if they are equivalent. To be equivalent,
all their elements must be so too.
An element is equivalent to the other if they can be converted to the¸ same type, and then if they are equals.
For example, the String "123" is equivalent to
new BigDecimal("123") or to 123L.
JsonObject clone(boolean mutable)
JsonObject, so any
modification to the original won't affect the
clone, and vice-versa.
Note that if the current object is immutable and
the mutable parameter is set to false,
then the current object will be returned as is, since no
cloning is required.
clone in interface JsonObjectOrArraymutable - if true the resulting
object and all its children will be mutable, otherwise
they will all be immutable.Copyright © 2018. All rights reserved.