Package org.openapitools.codegen.utils
Interface JsonCache
-
- All Known Subinterfaces:
JsonCache.Root
public interface JsonCache
An interface for querying and mutating a JSON object graph. Clients indicate the location within the graph at which a value is to be read or written using a JSON Pointer as either a string or aJsonPointer
instance. The latter is more efficient for repeated access to the same location. For theset(ptr|path, value)
andgetXxx(ptr|path, defaultValue)
methods, the cache automatically creates missing container elements in the path as either object or array nodes according to whether the corresponding path segment is a property name or an integer index respectively, and creates the leaf element as a JSON value node of the appropriate type. Existing tree elements identified by a JSON pointer must match the pointer segments by type; that is, an existing parent of an integer path segment must be an array node and existing parent of a property name path segment must be an object node: if this condition is not met, the method throws a JsonCache.CacheException. Note that it is possible to store the same object at multiple locations within the tree (thus converting the tree to a graph), in which case the same object may be retrieved using any of the corresponding paths. However, this shared object becomes multiple independent objects when serialised to JSON and if subsequently loaded into a cache instance. Such graphs must be acyclic: storing a cyclic graph in the tree will cause a stack overflow when the cache is saved. Instances are not guaranteed threadsafe and require external synchronisation if mutator methods may be called concurrently from multiple threads. Sparse arrays are not supported - all array elements have a value, even if it is null.N.B. some
getXxx()
methods can return mutable objects, mutations to which will be unobserved by the cache instance, thus compromising the reliability of theflush*()
methods. Callers relying on these methods should either not mutate such objects or they should call the appropriateset()
method afterwards to ensure that the cache's 'modified' flag is set.- Since:
- 4.0.0
- Author:
- Adrian Price, TIBCO Software Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
JsonCache.CacheException
Exception thrown by cache operations.static interface
JsonCache.Factory
A factory for creating JSON cache root instances.static interface
JsonCache.Root
Load/merge/save/flush functionality implemented by the root of a JSON cache hierarchy.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, boolean value)
Adds aboolean
to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, double value)
Adds adouble
value to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, float value)
Adds afloat
value to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, int value)
Adds anint
value to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, long value)
Adds along
value to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, short value)
Adds ashort
value to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, Object value)
Adds an object to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal value)
Adds aBigDecimal
to an array.JsonCache
add(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger value)
Adds aBigInteger
to an array.JsonCache
add(String path, boolean value)
Adds aboolean
value to an array.JsonCache
add(String path, double value)
Adds adouble
value to an array.JsonCache
add(String path, float value)
Adds afloat
value to an array.JsonCache
add(String path, int value)
Adds anint
value to an array.JsonCache
add(String path, long value)
Adds along
value to an array.JsonCache
add(String path, short value)
Adds ashort
value to an array.JsonCache
add(String path, Object value)
Adds an object to an array.JsonCache
add(String path, BigDecimal value)
Adds aBigDecimal
to an array.JsonCache
add(String path, BigInteger value)
Adds aBigInteger
to an array.JsonCache
child(com.fasterxml.jackson.core.JsonPointer ptr)
Returns a child cache rooted at the given location relative to the receiver's base pointer.JsonCache
child(String path)
Returns a child cache rooted at the given location relative to the receiver's base pointer.void
delete(com.fasterxml.jackson.core.JsonPointer ptr)
Deletes a property within the object graph managed by the receiver.void
delete(String path)
Deletes a property within the object graph managed by the receiver.boolean
exists(com.fasterxml.jackson.core.JsonPointer ptr)
Tests for the existence of the specified path within the object graph managed by the receiver.boolean
exists(String path)
Tests for the existence of the specified path within the object graph managed by the receiver.Object
get(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves anObject
value from within the graph.Object
get(com.fasterxml.jackson.core.JsonPointer ptr, Object defaultValue)
Retrieves anObject
value from within the graph.Object
get(String path)
Retrieves anObject
value from within the graph.Object
get(String path, Object defaultValue)
Retrieves anObject
value from within the graph.BigDecimal
getBigDecimal(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves aBigDecimal
value from within the graph.BigDecimal
getBigDecimal(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal defaultValue)
Retrieves aBigDecimal
value from within the graph.BigDecimal
getBigDecimal(String path)
Retrieves aBigDecimal
value from within the graph.BigDecimal
getBigDecimal(String path, BigDecimal defaultValue)
Retrieves aBigDecimal
value from within the graph.BigInteger
getBigInteger(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves aBigInteger
value from within the graph.BigInteger
getBigInteger(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger defaultValue)
Retrieves aBigInteger
value from within the graph.BigInteger
getBigInteger(String path)
Retrieves aBigInteger
value from within the graph.BigInteger
getBigInteger(String path, BigInteger defaultValue)
Retrieves aBigInteger
value from within the graph.byte[]
getBinary(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves abyte[]
value from within the graph.byte[]
getBinary(com.fasterxml.jackson.core.JsonPointer ptr, byte[] defaultValue)
Retrieves abyte[]
value from within the graph.byte[]
getBinary(String path)
Retrieves abyte[]
value from within the graph.byte[]
getBinary(String path, byte[] defaultValue)
Retrieves abyte[]
value from within the graph.boolean
getBoolean(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves aboolean
value from within the graph.boolean
getBoolean(com.fasterxml.jackson.core.JsonPointer ptr, boolean defaultValue)
Retrieves aboolean
value from within the graph.boolean
getBoolean(String path)
Retrieves aboolean
value from within the graph.boolean
getBoolean(String path, boolean defaultValue)
Retrieves aboolean
value from within the graph.double
getDouble(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves adouble
value from within the graph.double
getDouble(com.fasterxml.jackson.core.JsonPointer ptr, double defaultValue)
Retrieves adouble
value from within the graph.double
getDouble(String path)
Retrieves adouble
value from within the graph.double
getDouble(String path, double defaultValue)
Retrieves adouble
value from within the graph.float
getFloat(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves afloat
value from within the graph.float
getFloat(com.fasterxml.jackson.core.JsonPointer ptr, float defaultValue)
Retrieves afloat
value from within the graph.float
getFloat(String path)
Retrieves afloat
value from within the graph.float
getFloat(String path, float defaultValue)
Retrieves afloat
value from within the graph.int
getInt(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves anint
value from within the graph.int
getInt(com.fasterxml.jackson.core.JsonPointer ptr, int defaultValue)
Retrieves anint
value from within the graph.int
getInt(String path)
Retrieves anint
value from within the graph.int
getInt(String path, int defaultValue)
Retrieves anint
value from within the graph.long
getLong(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves along
value from within the graph.long
getLong(com.fasterxml.jackson.core.JsonPointer ptr, long defaultValue)
Retrieves along
value from within the graph.long
getLong(String path)
Retrieves along
value from within the graph.long
getLong(String path, long defaultValue)
Retrieves along
value from within the graph.com.fasterxml.jackson.databind.node.JsonNodeType
getNodeType(com.fasterxml.jackson.core.JsonPointer ptr)
Returns the node type at the specified location in the object graph.com.fasterxml.jackson.databind.node.JsonNodeType
getNodeType(String path)
Returns the node type at the specified location in the object graph.Number
getNumber(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves aNumber
value from within the graph.Number
getNumber(com.fasterxml.jackson.core.JsonPointer ptr, Number defaultValue)
Retrieves aNumber
value from within the graph.Number
getNumber(String path)
Retrieves aNumber
value from within the graph.Number
getNumber(String path, Number defaultValue)
Retrieves aNumber
value from within the graph.<T> T
getObject(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type)
Retrieves a typed object value from within the graph.<T> T
getObject(com.fasterxml.jackson.core.JsonPointer ptr, T defaultValue)
Retrieves a typed object value from within the graph.<T> T
getObject(String path, Class<T> type)
Retrieves a typed object value from within the graph.<T> T
getObject(String path, T defaultValue)
Retrieves a typed object value from within the graph.<T> List<T>
getObjects(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type)
Retrieves a typed list of objects from within the graph.<T> List<T>
getObjects(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type, List<T> defaultValue)
Retrieves a typed list of objects from within the graph.<T> List<T>
getObjects(String path, Class<T> type)
Retrieves a typed list of objects from within the graph.<T> List<T>
getObjects(String path, Class<T> type, List<T> defaultValue)
Retrieves a typed list of objects from within the graph.short
getShort(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves ashort
value from within the graph.short
getShort(com.fasterxml.jackson.core.JsonPointer ptr, short defaultValue)
Retrieves ashort
value from within the graph.short
getShort(String path)
Retrieves ashort
value from within the graph.short
getShort(String path, short defaultValue)
Retrieves ashort
value from within the graph.String
getString(com.fasterxml.jackson.core.JsonPointer ptr)
Retrieves aString
value from within the graph.String
getString(com.fasterxml.jackson.core.JsonPointer ptr, String defaultValue)
Retrieves aString
value from within the graph.String
getString(String path)
Retrieves aString
value from within the graph.String
getString(String path, String defaultValue)
Retrieves aString
value from within the graph.JsonCache
parent()
Returns the parent cache of which this is a descendant.JsonCache.Root
root()
Returns the root cache of which this is a descendant.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, boolean value)
Sets aboolean
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, double value)
Sets adouble
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, float value)
Sets afloat
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, int value)
Sets anint
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, long value)
Sets along
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, short value)
Sets ashort
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, Object value)
Sets anObject
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, String value)
Sets aString
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal value)
Sets aBigDecimal
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger value)
Sets aBigInteger
property within the object graph managed by the receiver.JsonCache
set(com.fasterxml.jackson.core.JsonPointer ptr, List<?> values)
Sets aList
property within the object graph managed by the receiver.JsonCache
set(String path, boolean value)
Sets aboolean
property within the object graph managed by the receiver.JsonCache
set(String path, double value)
Sets adouble
property within the object graph managed by the receiver.JsonCache
set(String path, float value)
Sets afloat
property within the object graph managed by the receiver.JsonCache
set(String path, int value)
Sets anint
property within the object graph managed by the receiver.JsonCache
set(String path, long value)
Sets along
property within the object graph managed by the receiver.JsonCache
set(String path, short value)
Sets ashort
property within the object graph managed by the receiver.JsonCache
set(String path, Object value)
Sets anObject
property within the object graph managed by the receiver.JsonCache
set(String path, String value)
Sets aString
property within the object graph managed by the receiver.JsonCache
set(String path, BigDecimal value)
Sets aBigDecimal
property within the object graph managed by the receiver.JsonCache
set(String path, BigInteger value)
Sets aBigInteger
property within the object graph managed by the receiver.JsonCache
set(String path, List<?> values)
Sets aList
property within the object graph managed by the receiver.int
size(com.fasterxml.jackson.core.JsonPointer ptr)
Returns the size of a node within the object graph managed by the receiver.int
size(String path)
Returns the size of a node within the object graph managed by the receiver.
-
-
-
Method Detail
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal value) throws JsonCache.CacheException
Adds aBigDecimal
to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger value) throws JsonCache.CacheException
Adds aBigInteger
to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, boolean value) throws JsonCache.CacheException
Adds aboolean
to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, double value) throws JsonCache.CacheException
Adds adouble
value to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, float value) throws JsonCache.CacheException
Adds afloat
value to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, int value) throws JsonCache.CacheException
Adds anint
value to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, long value) throws JsonCache.CacheException
Adds along
value to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, Object value) throws JsonCache.CacheException
Adds an object to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(com.fasterxml.jackson.core.JsonPointer ptr, short value) throws JsonCache.CacheException
Adds ashort
value to an array. The array is created if it does not already exist.- Parameters:
ptr
- A pointer to the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, BigDecimal value) throws JsonCache.CacheException
Adds aBigDecimal
to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, BigInteger value) throws JsonCache.CacheException
Adds aBigInteger
to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, boolean value) throws JsonCache.CacheException
Adds aboolean
value to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, double value) throws JsonCache.CacheException
Adds adouble
value to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, float value) throws JsonCache.CacheException
Adds afloat
value to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, int value) throws JsonCache.CacheException
Adds anint
value to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, long value) throws JsonCache.CacheException
Adds along
value to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, Object value) throws JsonCache.CacheException
Adds an object to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, short value) throws JsonCache.CacheException
Adds ashort
value to an array. The array is created if it does not already exist.- Parameters:
path
- A JSON Pointer expression for the property to set. If the last segment is a positive integer less than the current array size,value
is inserted at the specified index; otherwise, it is appended to the end of the array.value
- The value to add.- Returns:
- The receiver, to support chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.
-
child
JsonCache child(com.fasterxml.jackson.core.JsonPointer ptr)
Returns a child cache rooted at the given location relative to the receiver's base pointer.- Parameters:
ptr
- A pointer to the subtree managed by the new cache.- Returns:
- The child cache.
- Throws:
NullPointerException
- ifptr
isnull
.
-
child
JsonCache child(String path)
Returns a child cache rooted at the given location relative to the receiver's base pointer.- Parameters:
path
- A JSON Pointer expression for the subtree managed by the new cache. Note that the expression must start with a forward slash character.- Returns:
- The child cache.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
delete
void delete(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Deletes a property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
delete
void delete(String path) throws JsonCache.CacheException
Deletes a property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON path expression.JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
exists
boolean exists(com.fasterxml.jackson.core.JsonPointer ptr)
Tests for the existence of the specified path within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the path to test.- Returns:
true
if a JSON node corresponding toptr
exists.
-
exists
boolean exists(String path)
Tests for the existence of the specified path within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the path to test.- Returns:
true
if a JSON node corresponding toptr
exists.
-
get
Object get(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves anObject
value from within the graph.- Parameters:
ptr
- A JSON Pointer expression for the value to return.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
get
Object get(com.fasterxml.jackson.core.JsonPointer ptr, Object defaultValue) throws JsonCache.CacheException
Retrieves anObject
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A pointer to the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
get
Object get(String path) throws JsonCache.CacheException
Retrieves anObject
value from within the graph.- Parameters:
path
- A pointer to the value to return.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
get
Object get(String path, Object defaultValue) throws JsonCache.CacheException
Retrieves anObject
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBigDecimal
BigDecimal getBigDecimal(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aBigDecimal
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBigDecimal
BigDecimal getBigDecimal(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal defaultValue) throws JsonCache.CacheException
Retrieves aBigDecimal
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A pointer to the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBigDecimal
BigDecimal getBigDecimal(String path) throws JsonCache.CacheException
Retrieves aBigDecimal
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBigDecimal
BigDecimal getBigDecimal(String path, BigDecimal defaultValue) throws JsonCache.CacheException
Retrieves aBigDecimal
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBigInteger
BigInteger getBigInteger(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aBigInteger
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBigInteger
BigInteger getBigInteger(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger defaultValue) throws JsonCache.CacheException
Retrieves aBigInteger
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBigInteger
BigInteger getBigInteger(String path) throws JsonCache.CacheException
Retrieves aBigInteger
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBigInteger
BigInteger getBigInteger(String path, BigInteger defaultValue) throws JsonCache.CacheException
Retrieves aBigInteger
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBinary
byte[] getBinary(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves abyte[]
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBinary
byte[] getBinary(com.fasterxml.jackson.core.JsonPointer ptr, byte[] defaultValue) throws JsonCache.CacheException
Retrieves abyte[]
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBinary
byte[] getBinary(String path) throws JsonCache.CacheException
Retrieves abyte[]
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBinary
byte[] getBinary(String path, byte[] defaultValue) throws JsonCache.CacheException
Retrieves abyte[]
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBoolean
boolean getBoolean(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aboolean
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
false
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBoolean
boolean getBoolean(com.fasterxml.jackson.core.JsonPointer ptr, boolean defaultValue) throws JsonCache.CacheException
Retrieves aboolean
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getBoolean
boolean getBoolean(String path) throws JsonCache.CacheException
Retrieves aboolean
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
false
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getBoolean
boolean getBoolean(String path, boolean defaultValue) throws JsonCache.CacheException
Retrieves aboolean
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getDouble
double getDouble(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves adouble
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
0.0D
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getDouble
double getDouble(com.fasterxml.jackson.core.JsonPointer ptr, double defaultValue) throws JsonCache.CacheException
Retrieves adouble
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getDouble
double getDouble(String path) throws JsonCache.CacheException
Retrieves adouble
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0.0D
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getDouble
double getDouble(String path, double defaultValue) throws JsonCache.CacheException
Retrieves adouble
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getFloat
float getFloat(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves afloat
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
0.0F
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getFloat
float getFloat(com.fasterxml.jackson.core.JsonPointer ptr, float defaultValue) throws JsonCache.CacheException
Retrieves afloat
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getFloat
float getFloat(String path) throws JsonCache.CacheException
Retrieves afloat
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0.0F
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getFloat
float getFloat(String path, float defaultValue) throws JsonCache.CacheException
Retrieves afloat
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getInt
int getInt(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves anint
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
0
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getInt
int getInt(com.fasterxml.jackson.core.JsonPointer ptr, int defaultValue) throws JsonCache.CacheException
Retrieves anint
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getInt
int getInt(String path) throws JsonCache.CacheException
Retrieves anint
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getInt
int getInt(String path, int defaultValue) throws JsonCache.CacheException
Retrieves anint
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getLong
long getLong(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves along
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
0L
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getLong
long getLong(com.fasterxml.jackson.core.JsonPointer ptr, long defaultValue) throws JsonCache.CacheException
Retrieves along
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getLong
long getLong(String path) throws JsonCache.CacheException
Retrieves along
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0L
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getLong
long getLong(String path, long defaultValue) throws JsonCache.CacheException
Retrieves along
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getNodeType
com.fasterxml.jackson.databind.node.JsonNodeType getNodeType(com.fasterxml.jackson.core.JsonPointer ptr)
Returns the node type at the specified location in the object graph.- Parameters:
ptr
- A pointer to the node to test.- Returns:
- The node type.
-
getNodeType
com.fasterxml.jackson.databind.node.JsonNodeType getNodeType(String path)
Returns the node type at the specified location in the object graph.- Parameters:
path
- A JSON Pointer expression for the node to test.- Returns:
- The node type.
-
getNumber
Number getNumber(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aNumber
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getNumber
Number getNumber(com.fasterxml.jackson.core.JsonPointer ptr, Number defaultValue) throws JsonCache.CacheException
Retrieves aNumber
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getNumber
Number getNumber(String path) throws JsonCache.CacheException
Retrieves aNumber
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getNumber
Number getNumber(String path, Number defaultValue) throws JsonCache.CacheException
Retrieves aNumber
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getObject
<T> T getObject(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type) throws JsonCache.CacheException
Retrieves a typed object value from within the graph.- Type Parameters:
T
- The type of object to return.- Parameters:
ptr
- A pointer to the value to return.type
- The type of object to return.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver or if the node could not be converted to the requested type.
-
getObject
<T> T getObject(com.fasterxml.jackson.core.JsonPointer ptr, T defaultValue) throws JsonCache.CacheException
Retrieves a typed object value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Type Parameters:
T
- The type of the object to return.- Parameters:
ptr
- A pointer to the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver or if the node could not be converted to the requested type.
-
getObject
<T> T getObject(String path, Class<T> type) throws JsonCache.CacheException
Retrieves a typed object value from within the graph.- Type Parameters:
T
- The type of object to return.- Parameters:
path
- A JSON pointer expression for the value to return.type
- The type of object to return.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver or if the node could not be converted to the requested type.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getObject
<T> T getObject(String path, T defaultValue) throws JsonCache.CacheException
Retrieves a typed object value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Type Parameters:
T
- The type of the object to return.- Parameters:
path
- A JSON pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver or if the node could not be converted to the requested type.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getObjects
<T> List<T> getObjects(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type) throws JsonCache.CacheException
Retrieves a typed list of objects from within the graph.- Type Parameters:
T
- The list element type.- Parameters:
ptr
- A pointer to the values to return.type
- The list element type.- Returns:
- the property values.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver or if the nodes could not be converted to the requested type.
-
getObjects
<T> List<T> getObjects(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type, List<T> defaultValue) throws JsonCache.CacheException
Retrieves a typed list of objects from within the graph. If the values are not present, storesdefaultValue
at the specified location and returns this value.- Type Parameters:
T
- The list element type.- Parameters:
ptr
- A pointer to the values to return.type
- The list element type.defaultValue
- The default values to return ifptr
is not present in the graph.- Returns:
- the property values.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver or if the nodes could not be converted to the requested type.
-
getObjects
<T> List<T> getObjects(String path, Class<T> type) throws JsonCache.CacheException
Retrieves a typed list of objects from within the graph.- Type Parameters:
T
- The list element type.- Parameters:
path
- A JSON Pointer expression for the values to return.type
- The list element type.- Returns:
- the property values.
- Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver or if the nodes could not be converted to the requested type.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getObjects
<T> List<T> getObjects(String path, Class<T> type, List<T> defaultValue) throws JsonCache.CacheException
Retrieves a typed list of objects from within the graph. If the values are not present, storesdefaultValue
at the specified location and returns this value.- Type Parameters:
T
- The list element type.- Parameters:
path
- A JSON Pointer expression for the values to return.type
- The list element type.defaultValue
- The default values to return ifpath
is not present in the graph.- Returns:
- the property values.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver or if the nodes could not be converted to the requested type.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getShort
short getShort(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves ashort
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
0
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getShort
short getShort(com.fasterxml.jackson.core.JsonPointer ptr, short defaultValue) throws JsonCache.CacheException
Retrieves ashort
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getShort
short getShort(String path) throws JsonCache.CacheException
Retrieves ashort
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getShort
short getShort(String path, short defaultValue) throws JsonCache.CacheException
Retrieves ashort
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getString
String getString(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aString
value from within the graph.- Parameters:
ptr
- A pointer to the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getString
String getString(com.fasterxml.jackson.core.JsonPointer ptr, String defaultValue) throws JsonCache.CacheException
Retrieves aString
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
ptr
- A pointer to the value to return.defaultValue
- The default value to return ifptr
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.
-
getString
String getString(String path) throws JsonCache.CacheException
Retrieves aString
value from within the graph.- Parameters:
path
- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
null
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
getString
String getString(String path, String defaultValue) throws JsonCache.CacheException
Retrieves aString
value from within the graph. If the value is not present, storesdefaultValue
at the specified location and returns this value.- Parameters:
path
- A JSON Pointer expression for the value to return.defaultValue
- The default value to return ifpath
is not present in the graph.- Returns:
- the property value or
defaultValue
if not present. - Throws:
JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.IllegalArgumentException
- ifpath
is not a valid JSON path expression.
-
parent
JsonCache parent()
Returns the parent cache of which this is a descendant.- Returns:
- The parent cache,
null
if the receiver is the root cache.
-
root
JsonCache.Root root()
Returns the root cache of which this is a descendant.- Returns:
- The root cache. The root cache returns itself.
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal value) throws JsonCache.CacheException
Sets aBigDecimal
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger value) throws JsonCache.CacheException
Sets aBigInteger
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, boolean value) throws JsonCache.CacheException
Sets aboolean
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, double value) throws JsonCache.CacheException
Sets adouble
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, float value) throws JsonCache.CacheException
Sets afloat
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, int value) throws JsonCache.CacheException
Sets anint
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, List<?> values) throws JsonCache.CacheException
Sets aList
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.values
- The values to set.- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, long value) throws JsonCache.CacheException
Sets along
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, Object value) throws JsonCache.CacheException
Sets anObject
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, short value) throws JsonCache.CacheException
Sets ashort
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(com.fasterxml.jackson.core.JsonPointer ptr, String value) throws JsonCache.CacheException
Sets aString
property within the object graph managed by the receiver.- Parameters:
ptr
- A pointer to the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
JsonCache.CacheException
- ifptr
is not a valid path within the object graph managed by the receiver.- See Also:
delete(JsonPointer)
-
set
JsonCache set(String path, BigDecimal value) throws JsonCache.CacheException
Sets aBigDecimal
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, BigInteger value) throws JsonCache.CacheException
Sets aBigInteger
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, boolean value) throws JsonCache.CacheException
Sets aboolean
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, double value) throws JsonCache.CacheException
Sets adouble
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, float value) throws JsonCache.CacheException
Sets afloat
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, int value) throws JsonCache.CacheException
Sets anint
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, List<?> values) throws JsonCache.CacheException
Sets aList
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.values
- The values to set.- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, long value) throws JsonCache.CacheException
Sets along
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, Object value) throws JsonCache.CacheException
Sets anObject
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, short value) throws JsonCache.CacheException
Sets ashort
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set.- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
set
JsonCache set(String path, String value) throws JsonCache.CacheException
Sets aString
property within the object graph managed by the receiver.- Parameters:
path
- A JSON Pointer expression for the property to set.value
- The value to set (can be null).- Returns:
- The receiver, to allow chaining.
- Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.JsonCache.CacheException
- ifpath
is not a valid path within the object graph managed by the receiver.- See Also:
delete(String)
-
size
int size(com.fasterxml.jackson.core.JsonPointer ptr)
Returns the size of a node within the object graph managed by the receiver. For an array node, size is the number of elements; for an object node, size is the number of properties; for other node types, size is0
.- Parameters:
ptr
- A pointer to the node.- Returns:
- The size of the node, or
0
if it does not exist. - See Also:
delete(String)
-
size
int size(String path)
Returns the size of a node within the object graph managed by the receiver. For an array node, size is the number of elements; for an object node, size is the number of properties; for other node types, size is0
.- Parameters:
path
- A JSON pointer expression for the node.- Returns:
- The size of the node, or
0
if it does not exist. - Throws:
IllegalArgumentException
- ifpath
is not a valid JSON Pointer expression.- See Also:
delete(String)
-
-