public abstract class Values extends Object
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)
,
Record.asMap(Function)
and so on.
Modifier and Type | Field and Description |
---|---|
static Value |
EmptyMap |
static Value |
NULL |
Modifier and Type | Method and Description |
---|---|
static Value |
isoDuration(long months,
long days,
long seconds,
int nanoseconds) |
static Function<Value,Boolean> |
ofBoolean()
Converts values to
Boolean . |
static Function<Value,Double> |
ofDouble()
Converts values to
Double . |
static Function<Value,Entity> |
ofEntity()
Converts values to
Entity . |
static Function<Value,Long> |
ofEntityId()
Converts values to
entity id . |
static Function<Value,Float> |
ofFloat()
Converts values to
Float . |
static Function<Value,Integer> |
ofInteger()
Converts values to
Integer . |
static Function<Value,IsoDuration> |
ofIsoDuration()
Converts values to
IsoDuration . |
static Function<Value,List<Object>> |
ofList()
|
static <T> Function<Value,List<T>> |
ofList(Function<Value,T> innerMap)
Converts values to
List of T . |
static Function<Value,LocalDate> |
ofLocalDate()
Converts values to
LocalDate . |
static Function<Value,LocalDateTime> |
ofLocalDateTime()
Converts values to
LocalDateTime . |
static Function<Value,LocalTime> |
ofLocalTime()
Converts values to
LocalTime . |
static Function<Value,Long> |
ofLong()
Converts values to
Long . |
static Function<Value,Map<String,Object>> |
ofMap()
Converts values to
Map . |
static <T> Function<Value,Map<String,T>> |
ofMap(Function<Value,T> valueConverter)
Converts values to
Map , with the map values further converted using
the provided converter. |
static Function<Value,Node> |
ofNode()
Converts values to
Node . |
static Function<Value,Number> |
ofNumber()
Converts values to
Number . |
static Function<Value,Object> |
ofObject()
Converts values to objects using
Value.asObject() . |
static Function<Value,OffsetDateTime> |
ofOffsetDateTime()
Converts values to
OffsetDateTime . |
static Function<Value,OffsetTime> |
ofOffsetTime()
Converts values to
OffsetTime . |
static Function<Value,Path> |
ofPath()
Converts values to
Path . |
static Function<Value,Point> |
ofPoint()
Converts values to
Point . |
static Function<Value,Relationship> |
ofRelationship()
Converts values to
Relationship . |
static Function<Value,String> |
ofString()
Converts values to
String . |
static Function<Value,String> |
ofToString()
Converts values using
Value.toString() , a human-readable string
description of any value. |
static Function<Value,Value> |
ofValue()
The identity function for value conversion - returns the value untouched.
|
static Function<Value,ZonedDateTime> |
ofZonedDateTime()
Converts values to
ZonedDateTime . |
static Value |
parameters(Object... keysAndValues)
Helper function for creating a map of parameters, this can be used when you
run 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... input) |
static Value |
value(boolean val) |
static org.neo4j.driver.internal.value.BytesValue |
value(byte... input) |
static Value |
value(char... input) |
static Value |
value(char val) |
static Value |
value(double... input) |
static Value |
value(double val) |
static Value |
value(Duration duration) |
static Value |
value(float... input) |
static Value |
value(int... input) |
static Value |
value(int val) |
static Value |
value(Iterable<Object> val) |
static Value |
value(Iterator<Object> val) |
static Value |
value(List<Object> vals) |
static Value |
value(LocalDate localDate) |
static Value |
value(LocalDateTime localDateTime) |
static Value |
value(LocalTime localTime) |
static Value |
value(long... input) |
static Value |
value(long val) |
static Value |
value(Map<String,Object> val) |
static Value |
value(Object value) |
static Value |
value(OffsetDateTime offsetDateTime) |
static Value |
value(OffsetTime offsetTime) |
static Value |
value(Period period) |
static Value |
value(Stream<Object> stream) |
static Value |
value(String... input) |
static Value |
value(String val) |
static Value |
value(Value... input) |
static Value |
value(ZonedDateTime zonedDateTime) |
static Value[] |
values(Object... input) |
public static org.neo4j.driver.internal.value.BytesValue value(byte... input)
public static Value value(boolean... input)
public static Value value(char... input)
public static Value value(long... input)
public static Value value(int... input)
public static Value value(double... input)
public static Value value(float... input)
public static Value value(char val)
public static Value value(long val)
public static Value value(int val)
public static Value value(double val)
public static Value value(boolean val)
public static Value value(OffsetTime offsetTime)
public static Value value(LocalDateTime localDateTime)
public static Value value(OffsetDateTime offsetDateTime)
public static Value value(ZonedDateTime zonedDateTime)
public static Value isoDuration(long months, long days, long seconds, int nanoseconds)
public static Value point(int srid, double x, double y)
public static Value point(int srid, double x, double y, double z)
public static Value parameters(Object... keysAndValues)
run
queries.
Allowed parameter types are:
keysAndValues
- alternating sequence of keys and valuesQueryRunner.run(String, Value)
public static Function<Value,Value> ofValue()
public static Function<Value,Object> ofObject()
Value.asObject()
.Value.asObject()
of a Value
public static Function<Value,Number> ofNumber()
Number
.Value.asNumber()
of a Value
public static Function<Value,String> ofString()
String
.
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.
Value.asString()
of a Value
public static Function<Value,String> ofToString()
Value.toString()
, a human-readable string
description of any value.
This is different from ofString()
, which returns a java
String
value from a database TypeSystem.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()
.
Value.toString()
of a Value
public static Function<Value,Integer> ofInteger()
Integer
.Value.asInt()
of a Value
public static Function<Value,Long> ofLong()
Long
.Value.asLong()
of a Value
public static Function<Value,Float> ofFloat()
Float
.Value.asFloat()
of a Value
public static Function<Value,Double> ofDouble()
Double
.Value.asDouble()
of a Value
public static Function<Value,Boolean> ofBoolean()
Boolean
.Value.asBoolean()
of a Value
public static Function<Value,Map<String,Object>> ofMap()
Map
.MapAccessor.asMap()
of a Value
public static <T> Function<Value,Map<String,T>> ofMap(Function<Value,T> valueConverter)
Map
, with the map values further converted using
the provided converter.T
- the type of values in the returned mapvalueConverter
- converter to use for the values of the mapMapAccessor.asMap(Function)
of a Value
public static Function<Value,Entity> ofEntity()
Entity
.Value.asEntity()
of a Value
public static Function<Value,Long> ofEntityId()
entity id
.Value
public static Function<Value,Node> ofNode()
Node
.Value.asNode()
of a Value
public static Function<Value,Relationship> ofRelationship()
Relationship
.Value.asRelationship()
of a Value
public static Function<Value,Path> ofPath()
Path
.Value.asPath()
of a Value
public static Function<Value,LocalDate> ofLocalDate()
LocalDate
.Value.asLocalDate()
of a Value
public static Function<Value,OffsetTime> ofOffsetTime()
OffsetTime
.Value.asOffsetTime()
of a Value
public static Function<Value,LocalTime> ofLocalTime()
LocalTime
.Value.asLocalTime()
of a Value
public static Function<Value,LocalDateTime> ofLocalDateTime()
LocalDateTime
.Value.asLocalDateTime()
of a Value
public static Function<Value,OffsetDateTime> ofOffsetDateTime()
OffsetDateTime
.Value.asOffsetDateTime()
of a Value
public static Function<Value,ZonedDateTime> ofZonedDateTime()
ZonedDateTime
.Value.asZonedDateTime()
of a Value
public static Function<Value,IsoDuration> ofIsoDuration()
IsoDuration
.Value.asIsoDuration()
of a Value
public static Function<Value,Point> ofPoint()
Point
.Value.asPoint()
of a Value
public static Function<Value,List<Object>> ofList()
Value.asList()
of a Value
public static <T> Function<Value,List<T>> ofList(Function<Value,T> innerMap)
List
of T
.T
- the type of values inside the listinnerMap
- converter for the values inside the listValue.asList(Function)
of a Value
Copyright © 2019. All rights reserved.