Module org.neo4j.driver
Package org.neo4j.driver.internal.value
Class EntityValueAdapter<V extends Entity>
java.lang.Object
org.neo4j.driver.internal.types.InternalMapAccessorWithDefaultValue
org.neo4j.driver.internal.value.ValueAdapter
org.neo4j.driver.internal.value.ObjectValueAdapter<V>
org.neo4j.driver.internal.value.EntityValueAdapter<V>
- All Implemented Interfaces:
org.neo4j.driver.internal.AsValue
,InternalValue
,MapAccessor
,MapAccessorWithDefaultValue
,Value
- Direct Known Subclasses:
NodeValue
,RelationshipValue
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasEntity()
asMap()
Return the underlying map as a map of string keys and values converted usingValue.asObject()
.Retrieve the value of the property with the given keykeys()
If the underlying value supportskey-based indexing
, return an iterable of the keys in the map, this applies tomap
,node
andTypeSystem.RELATIONSHIP()
relationship} values.int
size()
If the underlying value is a collection type, return the number of values in the collection.Methods inherited from class org.neo4j.driver.internal.value.ObjectValueAdapter
asObject, equals, hashCode, toString
Methods inherited from class org.neo4j.driver.internal.value.ValueAdapter
asBoolean, asBoolean, asByteArray, asByteArray, asDouble, asDouble, asFloat, asFloat, asInt, asInt, asIsoDuration, asIsoDuration, asList, asList, asList, asList, asLocalDate, asLocalDate, asLocalDateTime, asLocalDateTime, asLocalTime, asLocalTime, asLong, asLong, asMap, asMap, asNode, asNumber, asOffsetDateTime, asOffsetDateTime, asOffsetTime, asOffsetTime, asPath, asPoint, asPoint, asRelationship, asString, asString, asValue, asZonedDateTime, asZonedDateTime, computeOrDefault, containsKey, get, hasType, isEmpty, isFalse, isNull, isTrue, typeConstructor, values, values
Methods inherited from class org.neo4j.driver.internal.types.InternalMapAccessorWithDefaultValue
get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
EntityValueAdapter
-
-
Method Details
-
asEntity
- Specified by:
asEntity
in interfaceValue
- Overrides:
asEntity
in classValueAdapter
- Returns:
- the value as a
Entity
, if possible.
-
asMap
Description copied from interface:MapAccessor
Return the underlying map as a map of string keys and values converted usingValue.asObject()
.This is equivalent to calling
MapAccessor.asMap(Function)
withValues.ofObject()
.- Specified by:
asMap
in interfaceMapAccessor
- Overrides:
asMap
in classValueAdapter
- Returns:
- the value as a Java map
-
asMap
- Specified by:
asMap
in interfaceMapAccessor
- Overrides:
asMap
in classValueAdapter
- Type Parameters:
T
- the type of map values- Parameters:
mapFunction
- a function to map from Value to T. SeeValues
for 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:
-
size
public int size()Description copied from interface:Value
If the underlying value is a collection type, return the number of values in the collection.For
TypeSystem.LIST()
list} values, this will return the size of the list.For
map
values, this will return the number of entries in the map.For
node
andTypeSystem.RELATIONSHIP()
relationship} values, this will return the number of properties.For
path
values, this returns the length (number of relationships) in the path.- Specified by:
size
in interfaceMapAccessor
- Specified by:
size
in interfaceValue
- Overrides:
size
in classValueAdapter
- Returns:
- the number of values in an underlying collection
-
keys
Description copied from interface:Value
If the underlying value supportskey-based indexing
, return an iterable of the keys in the map, this applies tomap
,node
andTypeSystem.RELATIONSHIP()
relationship} values.- Specified by:
keys
in interfaceMapAccessor
- Specified by:
keys
in interfaceValue
- Overrides:
keys
in classValueAdapter
- Returns:
- the keys in the value
-
get
Description copied from interface:MapAccessor
Retrieve the value of the property with the given key- Specified by:
get
in interfaceMapAccessor
- Overrides:
get
in classValueAdapter
- Parameters:
key
- the key of the property- Returns:
- the property's value or a
NullValue
if no such key exists
-