java.lang.Object
org.neo4j.driver.internal.types.InternalMapAccessorWithDefaultValue
org.neo4j.driver.internal.value.ValueAdapter
org.neo4j.driver.internal.value.ListValue
- All Implemented Interfaces:
org.neo4j.driver.internal.AsValue
,InternalValue
,MapAccessor
,MapAccessorWithDefaultValue
,Value
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasList()
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>
asObject()
This returns a java standard library representation of the underlying value, using a java type that is "sensible" given the underlying type.boolean
get
(int index) Retrieve the value at the given indexint
hashCode()
boolean
isEmpty()
If this value represents a list or map, test if the collection is empty.int
size()
If the underlying value is a collection type, return the number of values in the collection.toString()
type()
<T> Iterable<T>
Map and retrieve all values of the underlying collectionMethods inherited from class org.neo4j.driver.internal.value.ValueAdapter
asBoolean, asBoolean, asByteArray, asByteArray, asDouble, asDouble, asEntity, asFloat, asFloat, asInt, asInt, asIsoDuration, asIsoDuration, asList, asList, asLocalDate, asLocalDate, asLocalDateTime, asLocalDateTime, asLocalTime, asLocalTime, asLong, asLong, asMap, asMap, asMap, asMap, asNode, asNumber, asOffsetDateTime, asOffsetDateTime, asOffsetTime, asOffsetTime, asPath, asPoint, asPoint, asRelationship, asString, asString, asValue, asZonedDateTime, asZonedDateTime, computeOrDefault, containsKey, get, hasType, isFalse, isNull, isTrue, keys, typeConstructor, 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
-
Constructor Details
-
ListValue
-
-
Method Details
-
isEmpty
public boolean isEmpty()Description copied from interface:Value
If this value represents a list or map, test if the collection is empty.- Specified by:
isEmpty
in interfaceValue
- Overrides:
isEmpty
in classValueAdapter
- Returns:
true
if size() is 0, otherwisefalse
-
asObject
Description copied from interface:Value
This returns a java standard library representation of the underlying value, using a java type that is "sensible" given the underlying type. The mapping for common types is as follows:TypeSystem.NULL()
-null
TypeSystem.LIST()
-List
TypeSystem.MAP()
-Map
TypeSystem.BOOLEAN()
-Boolean
TypeSystem.INTEGER()
-Long
TypeSystem.FLOAT()
-Double
TypeSystem.STRING()
-String
TypeSystem.BYTES()
- byte[]TypeSystem.DATE()
-LocalDate
TypeSystem.TIME()
-OffsetTime
TypeSystem.LOCAL_TIME()
-LocalTime
TypeSystem.DATE_TIME()
-ZonedDateTime
TypeSystem.LOCAL_DATE_TIME()
-LocalDateTime
TypeSystem.DURATION()
-IsoDuration
TypeSystem.POINT()
-Point
TypeSystem.NODE()
-Node
TypeSystem.RELATIONSHIP()
-Relationship
TypeSystem.PATH()
-Path
TypeSystem
refers to the Neo4j type system whereTypeSystem.INTEGER()
andTypeSystem.FLOAT()
are both 64-bit precision. This is why these types return javaLong
andDouble
, respectively.- Specified by:
asObject
in interfaceValue
- Overrides:
asObject
in classValueAdapter
- Returns:
- the value as a Java Object.
-
asList
Description copied from interface:Value
If the underlying type can be viewed as a list, returns a java list of values, where each value has been converted usingValue.asObject()
.- Specified by:
asList
in interfaceValue
- Overrides:
asList
in classValueAdapter
- Returns:
- the value as a Java list of values, if possible
- See Also:
-
asList
- Specified by:
asList
in interfaceValue
- Overrides:
asList
in classValueAdapter
- Type Parameters:
T
- the type of target list elements- 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 list of T obtained by mapping from the list elements, 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
-
get
Description copied from interface:Value
Retrieve the value at the given index- Specified by:
get
in interfaceValue
- Overrides:
get
in classValueAdapter
- Parameters:
index
- the index of the value- Returns:
- the value or a
NullValue
if the index is out of bounds
-
values
Description copied from interface:MapAccessor
Map and retrieve all values of the underlying collection- Specified by:
values
in interfaceMapAccessor
- Overrides:
values
in classValueAdapter
- Type Parameters:
T
- the target type of mapping- Parameters:
mapFunction
- a function to map from Value to T. SeeValues
for some predefined functions, such asValues.ofBoolean()
,Values.ofList(Function)
.- Returns:
- the result of mapping all values in unspecified order
-
type
- Returns:
- The type of this value as defined in the Neo4j type system
-
toString
- Specified by:
toString
in interfaceValue
- Specified by:
toString
in classValueAdapter
-
equals
- Specified by:
equals
in interfaceValue
- Specified by:
equals
in classValueAdapter
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceValue
- Specified by:
hashCode
in classValueAdapter
-