Package org.openapitools.codegen.utils
Interface JsonCache
-
- All Known Subinterfaces:
JsonCache.Root
public interface JsonCacheAn 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 aJsonPointerinstance. 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 classJsonCache.CacheExceptionException thrown by cache operations.static interfaceJsonCache.FactoryA factory for creating JSON cache root instances.static interfaceJsonCache.RootLoad/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 JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, boolean value)Adds abooleanto an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, double value)Adds adoublevalue to an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, float value)Adds afloatvalue to an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, int value)Adds anintvalue to an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, long value)Adds alongvalue to an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, short value)Adds ashortvalue to an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, Object value)Adds an object to an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal value)Adds aBigDecimalto an array.JsonCacheadd(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger value)Adds aBigIntegerto an array.JsonCacheadd(String path, boolean value)Adds abooleanvalue to an array.JsonCacheadd(String path, double value)Adds adoublevalue to an array.JsonCacheadd(String path, float value)Adds afloatvalue to an array.JsonCacheadd(String path, int value)Adds anintvalue to an array.JsonCacheadd(String path, long value)Adds alongvalue to an array.JsonCacheadd(String path, short value)Adds ashortvalue to an array.JsonCacheadd(String path, Object value)Adds an object to an array.JsonCacheadd(String path, BigDecimal value)Adds aBigDecimalto an array.JsonCacheadd(String path, BigInteger value)Adds aBigIntegerto an array.JsonCachechild(com.fasterxml.jackson.core.JsonPointer ptr)Returns a child cache rooted at the given location relative to the receiver's base pointer.JsonCachechild(String path)Returns a child cache rooted at the given location relative to the receiver's base pointer.voiddelete(com.fasterxml.jackson.core.JsonPointer ptr)Deletes a property within the object graph managed by the receiver.voiddelete(String path)Deletes a property within the object graph managed by the receiver.booleanexists(com.fasterxml.jackson.core.JsonPointer ptr)Tests for the existence of the specified path within the object graph managed by the receiver.booleanexists(String path)Tests for the existence of the specified path within the object graph managed by the receiver.Objectget(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves anObjectvalue from within the graph.Objectget(com.fasterxml.jackson.core.JsonPointer ptr, Object defaultValue)Retrieves anObjectvalue from within the graph.Objectget(String path)Retrieves anObjectvalue from within the graph.Objectget(String path, Object defaultValue)Retrieves anObjectvalue from within the graph.BigDecimalgetBigDecimal(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves aBigDecimalvalue from within the graph.BigDecimalgetBigDecimal(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal defaultValue)Retrieves aBigDecimalvalue from within the graph.BigDecimalgetBigDecimal(String path)Retrieves aBigDecimalvalue from within the graph.BigDecimalgetBigDecimal(String path, BigDecimal defaultValue)Retrieves aBigDecimalvalue from within the graph.BigIntegergetBigInteger(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves aBigIntegervalue from within the graph.BigIntegergetBigInteger(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger defaultValue)Retrieves aBigIntegervalue from within the graph.BigIntegergetBigInteger(String path)Retrieves aBigIntegervalue from within the graph.BigIntegergetBigInteger(String path, BigInteger defaultValue)Retrieves aBigIntegervalue 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.booleangetBoolean(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves abooleanvalue from within the graph.booleangetBoolean(com.fasterxml.jackson.core.JsonPointer ptr, boolean defaultValue)Retrieves abooleanvalue from within the graph.booleangetBoolean(String path)Retrieves abooleanvalue from within the graph.booleangetBoolean(String path, boolean defaultValue)Retrieves abooleanvalue from within the graph.doublegetDouble(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves adoublevalue from within the graph.doublegetDouble(com.fasterxml.jackson.core.JsonPointer ptr, double defaultValue)Retrieves adoublevalue from within the graph.doublegetDouble(String path)Retrieves adoublevalue from within the graph.doublegetDouble(String path, double defaultValue)Retrieves adoublevalue from within the graph.floatgetFloat(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves afloatvalue from within the graph.floatgetFloat(com.fasterxml.jackson.core.JsonPointer ptr, float defaultValue)Retrieves afloatvalue from within the graph.floatgetFloat(String path)Retrieves afloatvalue from within the graph.floatgetFloat(String path, float defaultValue)Retrieves afloatvalue from within the graph.intgetInt(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves anintvalue from within the graph.intgetInt(com.fasterxml.jackson.core.JsonPointer ptr, int defaultValue)Retrieves anintvalue from within the graph.intgetInt(String path)Retrieves anintvalue from within the graph.intgetInt(String path, int defaultValue)Retrieves anintvalue from within the graph.longgetLong(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves alongvalue from within the graph.longgetLong(com.fasterxml.jackson.core.JsonPointer ptr, long defaultValue)Retrieves alongvalue from within the graph.longgetLong(String path)Retrieves alongvalue from within the graph.longgetLong(String path, long defaultValue)Retrieves alongvalue from within the graph.com.fasterxml.jackson.databind.node.JsonNodeTypegetNodeType(com.fasterxml.jackson.core.JsonPointer ptr)Returns the node type at the specified location in the object graph.com.fasterxml.jackson.databind.node.JsonNodeTypegetNodeType(String path)Returns the node type at the specified location in the object graph.NumbergetNumber(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves aNumbervalue from within the graph.NumbergetNumber(com.fasterxml.jackson.core.JsonPointer ptr, Number defaultValue)Retrieves aNumbervalue from within the graph.NumbergetNumber(String path)Retrieves aNumbervalue from within the graph.NumbergetNumber(String path, Number defaultValue)Retrieves aNumbervalue from within the graph.<T> TgetObject(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type)Retrieves a typed object value from within the graph.<T> TgetObject(com.fasterxml.jackson.core.JsonPointer ptr, T defaultValue)Retrieves a typed object value from within the graph.<T> TgetObject(String path, Class<T> type)Retrieves a typed object value from within the graph.<T> TgetObject(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.shortgetShort(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves ashortvalue from within the graph.shortgetShort(com.fasterxml.jackson.core.JsonPointer ptr, short defaultValue)Retrieves ashortvalue from within the graph.shortgetShort(String path)Retrieves ashortvalue from within the graph.shortgetShort(String path, short defaultValue)Retrieves ashortvalue from within the graph.StringgetString(com.fasterxml.jackson.core.JsonPointer ptr)Retrieves aStringvalue from within the graph.StringgetString(com.fasterxml.jackson.core.JsonPointer ptr, String defaultValue)Retrieves aStringvalue from within the graph.StringgetString(String path)Retrieves aStringvalue from within the graph.StringgetString(String path, String defaultValue)Retrieves aStringvalue from within the graph.JsonCacheparent()Returns the parent cache of which this is a descendant.JsonCache.Rootroot()Returns the root cache of which this is a descendant.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, boolean value)Sets abooleanproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, double value)Sets adoubleproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, float value)Sets afloatproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, int value)Sets anintproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, long value)Sets alongproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, short value)Sets ashortproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, Object value)Sets anObjectproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, String value)Sets aStringproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, BigDecimal value)Sets aBigDecimalproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, BigInteger value)Sets aBigIntegerproperty within the object graph managed by the receiver.JsonCacheset(com.fasterxml.jackson.core.JsonPointer ptr, List<?> values)Sets aListproperty within the object graph managed by the receiver.JsonCacheset(String path, boolean value)Sets abooleanproperty within the object graph managed by the receiver.JsonCacheset(String path, double value)Sets adoubleproperty within the object graph managed by the receiver.JsonCacheset(String path, float value)Sets afloatproperty within the object graph managed by the receiver.JsonCacheset(String path, int value)Sets anintproperty within the object graph managed by the receiver.JsonCacheset(String path, long value)Sets alongproperty within the object graph managed by the receiver.JsonCacheset(String path, short value)Sets ashortproperty within the object graph managed by the receiver.JsonCacheset(String path, Object value)Sets anObjectproperty within the object graph managed by the receiver.JsonCacheset(String path, String value)Sets aStringproperty within the object graph managed by the receiver.JsonCacheset(String path, BigDecimal value)Sets aBigDecimalproperty within the object graph managed by the receiver.JsonCacheset(String path, BigInteger value)Sets aBigIntegerproperty within the object graph managed by the receiver.JsonCacheset(String path, List<?> values)Sets aListproperty within the object graph managed by the receiver.intsize(com.fasterxml.jackson.core.JsonPointer ptr)Returns the size of a node within the object graph managed by the receiver.intsize(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 aBigDecimalto 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,valueis 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- ifptris 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 aBigIntegerto 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,valueis 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- ifptris 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 abooleanto 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,valueis 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- ifptris 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 adoublevalue 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,valueis 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- ifptris 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 afloatvalue 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,valueis 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- ifptris 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 anintvalue 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,valueis 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- ifptris 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 alongvalue 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,valueis 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- ifptris 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,valueis 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- ifptris 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 ashortvalue 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,valueis 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- ifptris not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, BigDecimal value) throws JsonCache.CacheException
Adds aBigDecimalto 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, BigInteger value) throws JsonCache.CacheException
Adds aBigIntegerto 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, boolean value) throws JsonCache.CacheException
Adds abooleanvalue 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, double value) throws JsonCache.CacheException
Adds adoublevalue 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, float value) throws JsonCache.CacheException
Adds afloatvalue 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, int value) throws JsonCache.CacheException
Adds anintvalue 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, long value) throws JsonCache.CacheException
Adds alongvalue 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.
-
add
JsonCache add(String path, short value) throws JsonCache.CacheException
Adds ashortvalue 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,valueis 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifpathis 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- ifptrisnull.
-
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- ifpathis not a valid JSON path expression.
-
delete
void delete(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionDeletes a property within the object graph managed by the receiver.- Parameters:
ptr- A pointer to the property to set.- Throws:
JsonCache.CacheException- ifptris 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- ifpathis not a valid JSON path expression.JsonCache.CacheException- ifptris 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:
trueif a JSON node corresponding toptrexists.
-
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:
trueif a JSON node corresponding toptrexists.
-
get
Object get(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves anObjectvalue from within the graph.- Parameters:
ptr- A JSON Pointer expression for the value to return.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifptris 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 anObjectvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A pointer to the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
get
Object get(String path) throws JsonCache.CacheException
Retrieves anObjectvalue from within the graph.- Parameters:
path- A pointer to the value to return.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
get
Object get(String path, Object defaultValue) throws JsonCache.CacheException
Retrieves anObjectvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getBigDecimal
BigDecimal getBigDecimal(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aBigDecimalvalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifptris 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 aBigDecimalvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A pointer to the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getBigDecimal
BigDecimal getBigDecimal(String path) throws JsonCache.CacheException
Retrieves aBigDecimalvalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getBigDecimal
BigDecimal getBigDecimal(String path, BigDecimal defaultValue) throws JsonCache.CacheException
Retrieves aBigDecimalvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getBigInteger
BigInteger getBigInteger(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aBigIntegervalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifptris 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 aBigIntegervalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getBigInteger
BigInteger getBigInteger(String path) throws JsonCache.CacheException
Retrieves aBigIntegervalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getBigInteger
BigInteger getBigInteger(String path, BigInteger defaultValue) throws JsonCache.CacheException
Retrieves aBigIntegervalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getBinary
byte[] getBinary(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionRetrieves abyte[]value from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves abyte[]value from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris 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
nullif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis 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, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getBoolean
boolean getBoolean(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionRetrieves abooleanvalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
falseif not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves abooleanvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getBoolean
boolean getBoolean(String path) throws JsonCache.CacheException
Retrieves abooleanvalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
falseif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getBoolean
boolean getBoolean(String path, boolean defaultValue) throws JsonCache.CacheException
Retrieves abooleanvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getDouble
double getDouble(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionRetrieves adoublevalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
0.0Dif not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves adoublevalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getDouble
double getDouble(String path) throws JsonCache.CacheException
Retrieves adoublevalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0.0Dif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getDouble
double getDouble(String path, double defaultValue) throws JsonCache.CacheException
Retrieves adoublevalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getFloat
float getFloat(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionRetrieves afloatvalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
0.0Fif not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves afloatvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getFloat
float getFloat(String path) throws JsonCache.CacheException
Retrieves afloatvalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0.0Fif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getFloat
float getFloat(String path, float defaultValue) throws JsonCache.CacheException
Retrieves afloatvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getInt
int getInt(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionRetrieves anintvalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
0if not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves anintvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getInt
int getInt(String path) throws JsonCache.CacheException
Retrieves anintvalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0if not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getInt
int getInt(String path, int defaultValue) throws JsonCache.CacheException
Retrieves anintvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getLong
long getLong(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionRetrieves alongvalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
0Lif not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves alongvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getLong
long getLong(String path) throws JsonCache.CacheException
Retrieves alongvalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0Lif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getLong
long getLong(String path, long defaultValue) throws JsonCache.CacheException
Retrieves alongvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis 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 aNumbervalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifptris 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 aNumbervalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getNumber
Number getNumber(String path) throws JsonCache.CacheException
Retrieves aNumbervalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getNumber
Number getNumber(String path, Number defaultValue) throws JsonCache.CacheException
Retrieves aNumbervalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getObject
<T> T getObject(com.fasterxml.jackson.core.JsonPointer ptr, Class<T> type) throws JsonCache.CacheExceptionRetrieves 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
nullif not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves a typed object value from within the graph. If the value is not present, storesdefaultValueat 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 ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris 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
nullif not present. - Throws:
JsonCache.CacheException- ifpathis 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- ifpathis 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, storesdefaultValueat 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 ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis 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- ifpathis 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- ifptris 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, storesdefaultValueat 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 ifptris not present in the graph.- Returns:
- the property values.
- Throws:
JsonCache.CacheException- ifptris 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- ifpathis 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- ifpathis 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, storesdefaultValueat 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 ifpathis not present in the graph.- Returns:
- the property values.
- Throws:
JsonCache.CacheException- ifptris 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- ifpathis not a valid JSON path expression.
-
getShort
short getShort(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheExceptionRetrieves ashortvalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
0if not present. - Throws:
JsonCache.CacheException- ifptris 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.CacheExceptionRetrieves ashortvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getShort
short getShort(String path) throws JsonCache.CacheException
Retrieves ashortvalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
0if not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getShort
short getShort(String path, short defaultValue) throws JsonCache.CacheException
Retrieves ashortvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getString
String getString(com.fasterxml.jackson.core.JsonPointer ptr) throws JsonCache.CacheException
Retrieves aStringvalue from within the graph.- Parameters:
ptr- A pointer to the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifptris 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 aStringvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
ptr- A pointer to the value to return.defaultValue- The default value to return ifptris not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifptris not a valid path within the object graph managed by the receiver.
-
getString
String getString(String path) throws JsonCache.CacheException
Retrieves aStringvalue from within the graph.- Parameters:
path- A JSON Pointer expression for the value to retrieve.- Returns:
- the property value or
nullif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
getString
String getString(String path, String defaultValue) throws JsonCache.CacheException
Retrieves aStringvalue from within the graph. If the value is not present, storesdefaultValueat the specified location and returns this value.- Parameters:
path- A JSON Pointer expression for the value to return.defaultValue- The default value to return ifpathis not present in the graph.- Returns:
- the property value or
defaultValueif not present. - Throws:
JsonCache.CacheException- ifpathis not a valid path within the object graph managed by the receiver.IllegalArgumentException- ifpathis not a valid JSON path expression.
-
parent
JsonCache parent()
Returns the parent cache of which this is a descendant.- Returns:
- The parent cache,
nullif 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 aBigDecimalproperty 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- ifptris 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 aBigIntegerproperty 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- ifptris 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 abooleanproperty 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- ifptris 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 adoubleproperty 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- ifptris 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 afloatproperty 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- ifptris 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 anintproperty 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- ifptris 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 aListproperty 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- ifptris 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 alongproperty 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- ifptris 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 anObjectproperty 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- ifptris 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 ashortproperty 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- ifptris 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 aStringproperty 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- ifptris 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 aBigDecimalproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 aBigIntegerproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 abooleanproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 adoubleproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 afloatproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 anintproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 aListproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 alongproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 anObjectproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 ashortproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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 aStringproperty 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- ifpathis not a valid JSON Pointer expression.JsonCache.CacheException- ifpathis 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
0if 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
0if it does not exist. - Throws:
IllegalArgumentException- ifpathis not a valid JSON Pointer expression.- See Also:
delete(String)
-
-