- All Known Subinterfaces:
Entity,InternalValue,MapAccessorWithDefaultValue,Node,Record,Relationship,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,UnsupportedTypeValue,ValueAdapter,VectorValue
public interface MapAccessor
Access the keys, properties and values of an underlying unordered map by key
This provides only read methods. Subclasses may choose to provide additional methods for changing the underlying map.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionasMap()Return the underlying map as a map of string keys and values converted usingValue.asObject().Return the underlying map as a map of string keys and values converted using the supplied function.booleancontainsKey(String key) Check if the list of keys contains the given keyRetrieve the value of the property with the given keykeys()Retrieve the keys of the underlying mapintsize()Retrieve the number of entries in this mapvalues()Retrieve all values of the underlying collection<T> Iterable<T> Map and retrieve all values of the underlying collection
-
Method Details
-
keys
Retrieve the keys of the underlying map- Returns:
- all map keys in unspecified order
-
containsKey
Check if the list of keys contains the given key- Parameters:
key- the key- Returns:
trueif this map keys contains the given key otherwisefalse
-
get
Retrieve the value of the property with the given key- Parameters:
key- the key of the property- Returns:
- the property's value or a
NullValueif no such key exists - Throws:
ClientException- if record has not been initialized
-
size
int size()Retrieve the number of entries in this map- Returns:
- the number of entries in this map
-
values
Retrieve all values of the underlying collection- Returns:
- all values in unspecified order
-
values
Map and retrieve all values of the underlying collection- Type Parameters:
T- the target type of mapping- Parameters:
mapFunction- a function to map from Value to T. SeeValuesfor some predefined functions, such asValues.ofBoolean(),Values.ofList(Function).- Returns:
- the result of mapping all values in unspecified order
-
asMap
Return the underlying map as a map of string keys and values converted usingValue.asObject().This is equivalent to calling
asMap(Function)withValues.ofObject().- Returns:
- the value as a Java map
-
asMap
Return the underlying map as a map of string keys and values converted using the supplied function.- Type Parameters:
T- the type of map values- Parameters:
mapFunction- a function to map from Value to T. SeeValuesfor some predefined functions, such asValues.ofBoolean(),Values.ofList(Function).- Returns:
- the value as a map from string keys to values of type T obtained from mapping the original map values, if possible
- See Also:
-