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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Value
isoDuration
(long months, long days, long seconds, int nanoseconds) Returns a value from month, day, seconds and nanoseconds values.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) Returns a value from SRID, x and y values.static Value
point
(int srid, double x, double y, double z) Returns a value from SRID, x ,y and z values.static Value
value
(boolean val) Returns a value from boolean.static Value
value
(boolean... input) Returns a value from boolean vararg.static Value
value
(byte... input) Returns a value from byte vararg.static Value
value
(char val) Returns a value from char.static Value
value
(char... input) Returns a value from char vararg.static Value
value
(double val) Returns a value from double.static Value
value
(double... input) Returns a value from double vararg.static Value
value
(float... input) Returns a value from float vararg.static Value
value
(int val) Returns a value from int.static Value
value
(int... input) Returns a value from int vararg.static Value
value
(long val) Returns a value from long.static Value
value
(long... input) Returns a value from long vararg.static Value
value
(short... input) Returns a value from short vararg.static Value
Returns a value from iterable of objects.static Value
Returns a value from object.static Value
Returns a value from string.static Value
Returns a value from string vararg.static Value
Returns a value from duration.static Value
Returns a value from local date.static Value
value
(LocalDateTime localDateTime) Returns a value from local date time.static Value
Returns a value from local time.static Value
value
(OffsetDateTime offsetDateTime) Returns a value from offset date time.static Value
value
(OffsetTime offsetTime) Returns a value from offset time.static Value
Returns a value from period.static Value
value
(ZonedDateTime zonedDateTime) Returns a value from zoned date time.static Value
Returns a value from iterator of objects.static Value
Returns a value from list of objects.static Value
Returns a value from string to object map.static Value
Returns a value from stream of objects.static Value
Returns a value from value vararg.static Value[]
Returns an array of values from object vararg.
-
Field Details
-
EmptyMap
The value instance of an empty map. -
NULL
The value instance ofNULL
.
-
-
Method Details
-
value
Returns a value from object.- Parameters:
value
- the object value- Returns:
- the array of values
-
values
Returns an array of values from object vararg.- Parameters:
input
- the object value(s)- Returns:
- the array of values
-
value
Returns a value from value vararg.- Parameters:
input
- the value(s)- Returns:
- the value
-
value
Returns a value from byte vararg.- Parameters:
input
- the byte value(s)- Returns:
- the value
-
value
Returns a value from string vararg.- Parameters:
input
- the string value(s)- Returns:
- the value
-
value
Returns a value from boolean vararg.- Parameters:
input
- the boolean value(s)- Returns:
- the value
-
value
Returns a value from char vararg.- Parameters:
input
- the char value(s)- Returns:
- the value
-
value
Returns a value from long vararg.- Parameters:
input
- the long value(s)- Returns:
- the value
-
value
Returns a value from short vararg.- Parameters:
input
- the short value(s)- Returns:
- the value
-
value
Returns a value from int vararg.- Parameters:
input
- the int value(s)- Returns:
- the value
-
value
Returns a value from double vararg.- Parameters:
input
- the double value(s)- Returns:
- the value
-
value
Returns a value from float vararg.- Parameters:
input
- the float value(s)- Returns:
- the value
-
value
Returns a value from list of objects.- Parameters:
vals
- the list of objects- Returns:
- the value
-
value
Returns a value from iterable of objects.- Parameters:
val
- the iterable of objects- Returns:
- the value
-
value
Returns a value from iterator of objects.- Parameters:
val
- the iterator of objects- Returns:
- the value
-
value
Returns a value from stream of objects.- Parameters:
stream
- the stream of objects- Returns:
- the value
-
value
Returns a value from char.- Parameters:
val
- the char value- Returns:
- the value
-
value
Returns a value from string.- Parameters:
val
- the string value- Returns:
- the value
-
value
Returns a value from long.- Parameters:
val
- the long value- Returns:
- the value
-
value
Returns a value from int.- Parameters:
val
- the int value- Returns:
- the value
-
value
Returns a value from double.- Parameters:
val
- the double value- Returns:
- the value
-
value
Returns a value from boolean.- Parameters:
val
- the boolean value- Returns:
- the value
-
value
Returns a value from string to object map.- Parameters:
val
- the string to object map- Returns:
- the value
-
value
Returns a value from local date.- Parameters:
localDate
- the local date value- Returns:
- the value
-
value
Returns a value from offset time.- Parameters:
offsetTime
- the offset time value- Returns:
- the value
-
value
Returns a value from local time.- Parameters:
localTime
- the local time value- Returns:
- the value
-
value
Returns a value from local date time.- Parameters:
localDateTime
- the local date time value- Returns:
- the value
-
value
Returns a value from offset date time.- Parameters:
offsetDateTime
- the offset date time value- Returns:
- the value
-
value
Returns a value from zoned date time.- Parameters:
zonedDateTime
- the zoned date time value- Returns:
- the value
-
value
Returns a value from period.- Parameters:
period
- the period value- Returns:
- the value
-
value
Returns a value from duration.- Parameters:
duration
- the duration value- Returns:
- the value
-
isoDuration
Returns a value from month, day, seconds and nanoseconds values.- Parameters:
months
- the month valuedays
- the day valueseconds
- the seconds valuenanoseconds
- the nanoseconds value- Returns:
- the value
-
point
Returns a value from SRID, x and y values.- Parameters:
srid
- the SRID valuex
- the x valuey
- the y value- Returns:
- the value
-
point
Returns a value from SRID, x ,y and z values.- Parameters:
srid
- the SRID valuex
- the x valuey
- the y valuez
- the z value- Returns:
- the value
-
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()
.