- All Superinterfaces:
MapAccessor
- All Known Subinterfaces:
InternalValue
,Record
,Value
- All Known Implementing Classes:
BooleanValue
,BytesValue
,DateTimeValue
,DateValue
,DurationValue
,EntityValueAdapter
,FloatValue
,IntegerValue
,InternalMapAccessorWithDefaultValue
,ListValue
,LocalDateTimeValue
,LocalTimeValue
,MapValue
,NodeValue
,NullValue
,NumberValueAdapter
,ObjectValueAdapter
,PathValue
,PointValue
,RelationshipValue
,StringValue
,TimeValue
,UnsupportedDateTimeValue
,ValueAdapter
Provides methods to access the value of an underlying unordered map by key. When calling the methods, a user need to provide a default value, which will be
given back if no match found by the key provided. The default value also servers the purpose of specifying the return type of the value found in map by key.
If the type of the value found A differs from the type of the default value B, a cast from A to B would happen automatically. Note: Error might arise if the
cast from A to B is not possible.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieve the java boolean with the given key.double
Retrieve the java double number with the given key.float
Retrieve the java float number with the given key.int
Retrieve the java integer with the given key.long
Retrieve the java long number with the given key.Retrieve the number with the given key.Retrieve the object with the given key.Retrieve the java string with the given key.Retrieve the list of objects with the given key.<T> List<T>
Retrieve the list with the given key.Retrieve the map with the given key.Retrieve the map with the given key.Retrieve the entity with the given key.Retrieve the node with the given key.Retrieve the path with the given key.get
(String key, Relationship defaultValue) Retrieve the value with the given key.Retrieve the value with the given key.Methods inherited from interface org.neo4j.driver.types.MapAccessor
asMap, asMap, containsKey, get, keys, size, values, values
-
Method Details
-
get
Retrieve the value with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the valuedefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the value found by the key or the default value if no such key exists
-
get
Retrieve the object with the given key. If no object found by the key, then the default object provided would be returned.- Parameters:
key
- the key of the objectdefaultValue
- the default object that would be returned if no object found by the key in the map- Returns:
- the object found by the key or the default object if no such key exists
-
get
Retrieve the number with the given key. If no number found by the key, then the default number provided would be returned.- Parameters:
key
- the key of the numberdefaultValue
- the default number that would be returned if no number found by the key in the map- Returns:
- the number found by the key or the default number if no such key exists
-
get
Retrieve the entity with the given key. If no entity found by the key, then the default entity provided would be returned.- Parameters:
key
- the key of the entitydefaultValue
- the default entity that would be returned if no entity found by the key in the map- Returns:
- the entity found by the key or the default entity if no such key exists
-
get
Retrieve the node with the given key. If no node found by the key, then the default node provided would be returned.- Parameters:
key
- the key of the nodedefaultValue
- the default node that would be returned if no node found by the key in the map- Returns:
- the node found by the key or the default node if no such key exists
-
get
Retrieve the path with the given key. If no path found by the key, then the default path provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default path that would be returned if no path found by the key in the map- Returns:
- the path found by the key or the default path if no such key exists
-
get
Retrieve the value with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the value found by the key or the default value if no such key exists
-
get
Retrieve the list of objects with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the valuedefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the list of objects found by the key or the default value if no such key exists
-
get
Retrieve the list with the given key. If no value found by the key, then the default list provided would be returned.- Type Parameters:
T
- the type of the elements in the returned list- Parameters:
key
- the key of the valuedefaultValue
- the default value that would be returned if no value found by the key in the mapmapFunc
- the map function that defines how to map each element of the list fromValue
to T- Returns:
- the converted list found by the key or the default list if no such key exists
-
get
Retrieve the map with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the map found by the key or the default value if no such key exists
-
get
Retrieve the map with the given key. If no value found by the key, then the default map provided would be returned.- Type Parameters:
T
- the type of the values in the returned map- Parameters:
key
- the key of the valuedefaultValue
- the default value that would be returned if no value found by the key in the mapmapFunc
- the map function that defines how to map each value in map fromValue
to T- Returns:
- the converted map found by the key or the default map if no such key exists.
-
get
Retrieve the java integer with the given key. If no integer found by the key, then the default integer provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default integer that would be returned if no integer found by the key in the map- Returns:
- the integer found by the key or the default integer if no such key exists
-
get
Retrieve the java long number with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the java long number found by the key or the default value if no such key exists
-
get
Retrieve the java boolean with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the java boolean found by the key or the default value if no such key exists
-
get
Retrieve the java string with the given key. If no string found by the key, then the default string provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default string that would be returned if no string found by the key in the map- Returns:
- the string found by the key or the default string if no such key exists
-
get
Retrieve the java float number with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the java float number found by the key or the default value if no such key exists
-
get
Retrieve the java double number with the given key. If no value found by the key, then the default value provided would be returned.- Parameters:
key
- the key of the propertydefaultValue
- the default value that would be returned if no value found by the key in the map- Returns:
- the java double number found by the key or the default value if no such key exists
-