java.lang.Object
org.neo4j.driver.Values
Utility for wrapping regular Java types and exposing them as
Value
objects, and vice versa.
The long set of ofXXX
methods in this class are meant to be used as
arguments for methods like Value.asList(Function)
, MapAccessor.asMap(Function)
,
MapAccessor.asMap(Function)
and so on.
- Since:
- 1.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Value
isoDuration
(long months, long days, long seconds, int nanoseconds) Converts values toBoolean
.ofDouble()
Converts values toDouble
.ofEntity()
Converts values toEntity
.Converts values toelement id
.Deprecated.ofFloat()
Converts values toFloat
.Converts values toInteger
.static Function<Value,
IsoDuration> Converts values toIsoDuration
.ofList()
Converts values toList
ofT
.Converts values toLocalDate
.static Function<Value,
LocalDateTime> Converts values toLocalDateTime
.Converts values toLocalTime
.ofLong()
Converts values toLong
.ofMap()
Converts values toMap
.Converts values toMap
, with the map values further converted using the provided converter.ofNode()
Converts values toNode
.ofNumber()
Converts values toNumber
.ofObject()
Converts values to objects usingValue.asObject()
.static Function<Value,
OffsetDateTime> Converts values toOffsetDateTime
.static Function<Value,
OffsetTime> Converts values toOffsetTime
.ofPath()
Converts values toPath
.ofPoint()
Converts values toPoint
.static Function<Value,
Relationship> Converts values toRelationship
.ofString()
Converts values toString
.Converts values usingValue.toString()
, a human-readable string description of any value.ofValue()
The identity function for value conversion - returns the value untouched.static Function<Value,
ZonedDateTime> Converts values toZonedDateTime
.static Value
parameters
(Object... keysAndValues) Helper function for creating a map of parameters, this can be used when yourun
queries.static Value
point
(int srid, double x, double y) static Value
point
(int srid, double x, double y, double z) static Value
value
(boolean val) static Value
value
(boolean... input) static Value
value
(byte... input) static Value
value
(char val) static Value
value
(char... input) static Value
value
(double val) static Value
value
(double... input) static Value
value
(float... input) static Value
value
(int val) static Value
value
(int... input) static Value
value
(long val) static Value
value
(long... input) static Value
value
(short... input) static Value
static Value
static Value
static Value
static Value
static Value
static Value
value
(LocalDateTime localDateTime) static Value
static Value
value
(OffsetDateTime offsetDateTime) static Value
value
(OffsetTime offsetTime) static Value
static Value
value
(ZonedDateTime zonedDateTime) static Value
static Value
static Value
static Value
static Value
static Value[]
-
Field Details
-
EmptyMap
-
NULL
-
-
Method Details
-
value
-
values
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
isoDuration
-
point
-
point
-
parameters
Helper function for creating a map of parameters, this can be used when yourun
queries.Allowed parameter types are:
- Parameters:
keysAndValues
- alternating sequence of keys and values- Returns:
- Map containing all parameters specified
- See Also:
-
ofValue
The identity function for value conversion - returns the value untouched.- Returns:
- a function that returns the value passed into it - the identity function
-
ofObject
Converts values to objects usingValue.asObject()
.- Returns:
- a function that returns
Value.asObject()
of aValue
-
ofNumber
Converts values toNumber
.- Returns:
- a function that returns
Value.asNumber()
of aValue
-
ofString
Converts values toString
.If you want to access a string you've retrieved from the database, this is the right choice. If you want to print any value for human consumption, for instance in a log,
ofToString()
is the right choice.- Returns:
- a function that returns
Value.asString()
of aValue
-
ofToString
Converts values usingValue.toString()
, a human-readable string description of any value.This is different from
ofString()
, which returns a javaString
value from a databaseTypeSystem.STRING()
.If you are wanting to print any value for human consumption, this is the right choice. If you are wanting to access a string value stored in the database, you should use
ofString()
.- Returns:
- a function that returns
Value.toString()
of aValue
-
ofInteger
Converts values toInteger
.- Returns:
- a function that returns
Value.asInt()
of aValue
-
ofLong
Converts values toLong
.- Returns:
- a function that returns
Value.asLong()
of aValue
-
ofFloat
Converts values toFloat
.- Returns:
- a function that returns
Value.asFloat()
of aValue
-
ofDouble
Converts values toDouble
.- Returns:
- a function that returns
Value.asDouble()
of aValue
-
ofBoolean
Converts values toBoolean
.- Returns:
- a function that returns
Value.asBoolean()
of aValue
-
ofMap
Converts values toMap
.- Returns:
- a function that returns
MapAccessor.asMap()
of aValue
-
ofMap
Converts values toMap
, with the map values further converted using the provided converter.- Type Parameters:
T
- the type of values in the returned map- Parameters:
valueConverter
- converter to use for the values of the map- Returns:
- a function that returns
MapAccessor.asMap(Function)
of aValue
-
ofEntity
Converts values toEntity
.- Returns:
- a function that returns
Value.asEntity()
of aValue
-
ofEntityId
Deprecated.superseded byofEntityElementId()
.Converts values toentity id
.- Returns:
- a function that returns the id an entity
Value
-
ofEntityElementId
Converts values toelement id
.- Returns:
- a function that returns the element id of an entity
Value
-
ofNode
Converts values toNode
.- Returns:
- a function that returns
Value.asNode()
of aValue
-
ofRelationship
Converts values toRelationship
.- Returns:
- a function that returns
Value.asRelationship()
of aValue
-
ofPath
Converts values toPath
.- Returns:
- a function that returns
Value.asPath()
of aValue
-
ofLocalDate
Converts values toLocalDate
.- Returns:
- a function that returns
Value.asLocalDate()
of aValue
-
ofOffsetTime
Converts values toOffsetTime
.- Returns:
- a function that returns
Value.asOffsetTime()
of aValue
-
ofLocalTime
Converts values toLocalTime
.- Returns:
- a function that returns
Value.asLocalTime()
of aValue
-
ofLocalDateTime
Converts values toLocalDateTime
.- Returns:
- a function that returns
Value.asLocalDateTime()
of aValue
-
ofOffsetDateTime
Converts values toOffsetDateTime
.- Returns:
- a function that returns
Value.asOffsetDateTime()
of aValue
-
ofZonedDateTime
Converts values toZonedDateTime
.- Returns:
- a function that returns
Value.asZonedDateTime()
of aValue
-
ofIsoDuration
Converts values toIsoDuration
.- Returns:
- a function that returns
Value.asIsoDuration()
of aValue
-
ofPoint
Converts values toPoint
.- Returns:
- a function that returns
Value.asPoint()
of aValue
-
ofList
- Returns:
- a function that returns
Value.asList()
of aValue
-
ofList
Converts values toList
ofT
.- Type Parameters:
T
- the type of values inside the list- Parameters:
innerMap
- converter for the values inside the list- Returns:
- a function that returns
Value.asList(Function)
of aValue
-
ofEntityElementId()
.