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 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,List<Object>> |
ofList()
|
static <T> Function<Value,List<T>> |
ofList(Function<Value,T> innerMap)
Converts values to
List of T. |
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,Path> |
ofPath()
Converts values to
Path. |
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 Value |
parameters(Object... keysAndValues)
Helper function for creating a map of parameters, this can be used when you
run statements. |
static Value |
value(boolean... input) |
static Value |
value(boolean val) |
static Value |
value(double... input) |
static Value |
value(double val) |
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(long... input) |
static Value |
value(long val) |
static Value |
value(Map<String,Object> val) |
static Value |
value(Object value) |
static Value |
value(String... input) |
static Value |
value(String val) |
static Value |
value(Value... input) |
static Value[] |
values(Object... input) |
public static Value value(boolean... 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(long val)
public static Value value(int val)
public static Value value(double val)
public static Value value(boolean val)
public static Value parameters(Object... keysAndValues)
run statements.
Allowed parameter types are:
keysAndValues - alternating sequence of keys and valuesStatementRunner.run(String, Value)public static Function<Value,Value> ofValue()
public static Function<Value,Object> ofObject()
Value.asObject().Value.asObject() of a Valuepublic static Function<Value,Number> ofNumber()
Number.Value.asNumber() of a Valuepublic 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 Valuepublic 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 Valuepublic static Function<Value,Integer> ofInteger()
Integer.Value.asInt() of a Valuepublic static Function<Value,Long> ofLong()
Long.Value.asLong() of a Valuepublic static Function<Value,Float> ofFloat()
Float.Value.asFloat() of a Valuepublic static Function<Value,Double> ofDouble()
Double.Value.asDouble() of a Valuepublic static Function<Value,Boolean> ofBoolean()
Boolean.Value.asBoolean() of a Valuepublic static Function<Value,Map<String,Object>> ofMap()
Map.MapAccessor.asMap() of a Valuepublic 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 Valuepublic static Function<Value,Entity> ofEntity()
Entity.Value.asEntity() of a Valuepublic static Function<Value,Long> ofEntityId()
entity id.Valuepublic static Function<Value,Node> ofNode()
Node.Value.asNode() of a Valuepublic static Function<Value,Relationship> ofRelationship()
Relationship.Value.asRelationship() of a Valuepublic static Function<Value,Path> ofPath()
Path.Value.asPath() of a Valuepublic static Function<Value,List<Object>> ofList()
Value.asList() of a ValueCopyright © 2017. All rights reserved.