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.bolt.connection.values.Value, InternalValue, MapAccessor, MapAccessorWithDefaultValue, Value
- Direct Known Subclasses:
NodeValue, RelationshipValue
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasEntity()Returns the value as aEntity, if possible.asMap()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.Retrieve the value of the property with the given keykeys()Retrieve the keys of the underlying mapintsize()Retrieve the number of entries in this mapMethods inherited from class ObjectValueAdapter
asObject, equals, hashCode, toStringMethods inherited from class ValueAdapter
asBoltVector, 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, asMapped, asNode, asNumber, asOffsetDateTime, asOffsetDateTime, asOffsetTime, asOffsetTime, asPath, asPoint, asPoint, asRelationship, asString, asString, asUnsupportedType, asUUID, asValue, asVector, asZonedDateTime, asZonedDateTime, computeOrDefault, containsKey, get, hasType, isEmpty, isFalse, isNull, isTrue, typeConstructor, values, valuesModifier and TypeMethodDescriptionorg.neo4j.bolt.connection.values.VectorbooleanReturns the value as a Java boolean, if possible.booleanasBoolean(boolean defaultValue) Returns the value as a Java boolean, if possible.byte[]Returns the value as a Java byte array, if possible.byte[]asByteArray(byte[] defaultValue) Returns the value as a Java byte array, if possible.doubleasDouble()Returns a Java double if no precision is lost in the conversion.doubleasDouble(double defaultValue) Returns a Java double if no precision is lost in the conversion.floatasFloat()Returns a Java float if no precision is lost in the conversion.floatasFloat(float defaultValue) Returns a Java float if no precision is lost in the conversion.intasInt()Returns a Java int if no precision is lost in the conversion.intasInt(int defaultValue) Returns a Java int if no precision is lost in the conversion.Returns the value as aIsoDuration, if possible.asIsoDuration(IsoDuration defaultValue) Returns the value as aIsoDuration, if possible.asList()If the underlying type can be viewed as a list, returns a java list of values, where each value has been converted usingValue.asObject().<T> List<T> Returns the value as a list of T obtained by mapping from the list elements, if possible.<T> List<T> Returns the value as a list of T obtained by mapping from the list elements, if possible.If the underlying type can be viewed as a list, returns a java list of values, where each value has been converted usingValue.asObject().Returns the value as aLocalDate, if possible.asLocalDate(LocalDate defaultValue) Returns the value as aLocalDate, if possible.Returns the value as aLocalDateTime, if possible.asLocalDateTime(LocalDateTime defaultValue) Returns the value as aLocalDateTime, if possible.Returns the value as aLocalTime, if possible.asLocalTime(LocalTime defaultValue) Returns the value as aLocalTime, if possible.longasLong()Returns a Java long if no precision is lost in the conversion.longasLong(long defaultValue) Returns a Java long if no precision is lost in the conversion.Returns the value as a map from string keys to values of type T obtained from mapping he original map values, if possible.Return as a map of string keys and values converted usingValue.asObject().protected <T> TasNode()Returns the value as aNode, if possible.asNumber()Returns the value as a Java Number, if possible.Returns the value as aOffsetDateTime, if possible.asOffsetDateTime(OffsetDateTime defaultValue) Returns the value as aOffsetDateTime, if possible.Returns the value as aOffsetTime, if possible.asOffsetTime(OffsetTime defaultValue) Returns the value as aOffsetTime, if possible.asPath()Returns the value as aPath, if possible.asPoint()Returns the value as aPoint, if possible.Returns the value as aPoint, if possible.Returns the value as aRelationship, if possible.asString()Returns the value as a Java String, if possible.Returns the value as a Java String, if possible.Returns the value as anUnsupportedType, if possible.asUUID()Returns the value as aUUID, if possible.asValue()asVector()Returns the value as anVector, if possible.Returns the value as aZonedDateTime, if possible.asZonedDateTime(ZonedDateTime defaultValue) Returns the value as aZonedDateTime, if possible.<T> TcomputeOrDefault(Function<Value, T> mapper, T defaultValue) booleancontainsKey(String key) Check if the list of keys contains the given keyget(int index) Retrieve the value at the given indexbooleanTest if this value is a value of the given type.booleanisEmpty()If this value represents a list or map, test if the collection is empty.booleanisFalse()Returnstrueif the value is a Boolean value and has the value False.booleanisNull()Returnstrueif the value is a Null, otherwisefalse.booleanisTrue()Returnstrueif the value is a Boolean value and has the value True.final TypeConstructorvalues()Retrieve all values of the underlying collection<T> Iterable<T> Map and retrieve all values of the underlying collectionMethods inherited from class InternalMapAccessorWithDefaultValue
get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getModifier and TypeMethodDescriptionbooleanRetrieve the java boolean with the given key.doubleRetrieve the java double number with the given key.floatRetrieve the java float number with the given key.intRetrieve the java integer with the given key.longRetrieve 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 InternalValue
as, as, asBoltIsoDuration, asBoltMap, asBoltPoint, boltValues, getBoltValueModifier and TypeMethodDescriptiondefault Objectas(ParameterizedType type) default Objectdefault org.neo4j.bolt.connection.values.IsoDurationdefault org.neo4j.bolt.connection.values.Pointdefault Iterable<org.neo4j.bolt.connection.values.Value> default org.neo4j.bolt.connection.values.ValuegetBoltValue(String key) Methods inherited from interface org.neo4j.bolt.connection.values.Value
boltValueType
-
Constructor Details
-
EntityValueAdapter
-
-
Method Details
-
asEntity
-
asMap
Description copied from interface:MapAccessorReturn 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:
asMapin interfaceMapAccessor- Overrides:
asMapin classValueAdapter- Returns:
- the value as a Java map
-
asMap
Description copied from interface:MapAccessorReturn the underlying map as a map of string keys and values converted using the supplied function.- Specified by:
asMapin interfaceMapAccessor- Overrides:
asMapin classValueAdapter- 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:
-
size
public int size()Description copied from interface:MapAccessorRetrieve the number of entries in this map- Specified by:
sizein interfaceMapAccessor- Specified by:
sizein interfaceValue- Overrides:
sizein classValueAdapter- Returns:
- the number of entries in this map
-
keys
Description copied from interface:MapAccessorRetrieve the keys of the underlying map- Specified by:
keysin interfaceMapAccessor- Specified by:
keysin interfaceValue- Overrides:
keysin classValueAdapter- Returns:
- all map keys in unspecified order
-
get
Description copied from interface:MapAccessorRetrieve the value of the property with the given key- Specified by:
getin interfaceMapAccessor- Overrides:
getin classValueAdapter- Parameters:
key- the key of the property- Returns:
- the property's value or a
NullValueif no such key exists
-