Class GValue<V>
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V>
- All Implemented Interfaces:
Serializable,Cloneable
A
GValue is a variable or literal value that is used in a Traversal. It is composed of a key-value
pair where the key is the name given to the variable and the value is the object that the variable resolved to. If
the name is not given, the value was provided literally in the traversal. The value of the variable can be any
object.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclone()static booleancontainsGValues(Object... args) Tests if any of the objects are GValues.static booleancontainsVariables(Object... args) Tests if any of the objects are GValues or GValueConstantTraversal, and if so, if they are variables.static <T> GValue<T>[]ensureGValues(Object[] args) The elements in object array argument are examined to see if they areGValueobjects.booleanget()Gets the value.static <T> TIf the object is aGValuethen get its value, otherwise return the object as-is.getName()Gets the name of the variable if it was defined as such and returns null if the value was a literal.inthashCode()booleanisNull()Determines if the value held is of anullvalue.booleanDetermines if the value held by this object was defined as a variable or a literal value.static <V> GValue<V>Create a newVarwith the specified name and value.static <V> GValue<V>of(V value) Create a newVarfrom a particular value but without the specified name.static GValue<BigDecimal>ofBigDecimal(String name, BigDecimal value) Create a newGValuefor a BigDecimal value with a specified name.static GValue<BigDecimal>ofBigDecimal(BigDecimal value) Create a newGValuefor a BigDecimal value.static GValue<BigInteger>ofBigInteger(String name, BigInteger value) Create a newGValuefor a BigInteger value with a specified name.static GValue<BigInteger>ofBigInteger(BigInteger value) Create a newGValuefor a BigInteger value.Create a newGValuefor a boolean value.Create a newGValuefor a boolean value with a specified name.Create a newGValuefor a double value.Create a newGValuefor a double value with a specified name.Create a newGValuefor an integer value.Create a newGValuefor an integer value with a specified name.Create a newGValuefor a list value with a specified name.Create a newGValuefor a list value.Create a newGValuefor a long value.Create a newGValuefor a long value with a specified name.Create a newGValuefor a map value with a specified name.Create a newGValuefor a map value.Create a newGValuefor a set value with a specified name.Create a newGValuefor a set value.Create a newGValuefor a string value.Create a newGValuefor a string value with a specified name.Create a newGValuefor a vertex value with a specified name.Create a newGValuefor a vertex value.static Object[]resolveToValues(GValue<?>[] gvalues) ConvertsGValueobjects argument array to their values to prevent them from leaking to the Graph API.toString()static booleanvalueInstanceOf(Object o, Class<?> type) static ObjectTakes an argument that is either aGValueor an object and if the former, returns the child object and if the latter returns the object itself.
-
Method Details
-
isVariable
public boolean isVariable()Determines if the value held by this object was defined as a variable or a literal value. Literal values simply have no name. -
getName
Gets the name of the variable if it was defined as such and returns null if the value was a literal. -
isNull
public boolean isNull()Determines if the value held is of anullvalue. -
get
Gets the value. -
toString
-
equals
-
hashCode
public int hashCode() -
clone
-
of
Create a newVarfrom a particular value but without the specified name. If the argument provide is already aGValuethen it is returned as-is.- Parameters:
value- the value of the variable
-
of
Create a newVarwith the specified name and value. If the argument provide is already aGValuethen an IllegalArgumentException is thrown.- Parameters:
name- the name of the variablevalue- the value of the variable- Throws:
IllegalArgumentException- if value is already aGValue
-
ofString
Create a newGValuefor a string value. -
ofString
Create a newGValuefor a string value with a specified name. -
ofInteger
Create a newGValuefor an integer value. -
ofInteger
Create a newGValuefor an integer value with a specified name. -
ofBoolean
Create a newGValuefor a boolean value. -
ofBoolean
Create a newGValuefor a boolean value with a specified name. -
ofDouble
Create a newGValuefor a double value. -
ofDouble
Create a newGValuefor a double value with a specified name. -
ofBigInteger
Create a newGValuefor a BigInteger value. -
ofBigInteger
Create a newGValuefor a BigInteger value with a specified name. -
ofBigDecimal
Create a newGValuefor a BigDecimal value. -
ofBigDecimal
Create a newGValuefor a BigDecimal value with a specified name. -
ofLong
Create a newGValuefor a long value. -
ofLong
Create a newGValuefor a long value with a specified name. -
ofMap
Create a newGValuefor a map value. -
ofMap
Create a newGValuefor a map value with a specified name. -
ofList
Create a newGValuefor a list value. -
ofList
Create a newGValuefor a list value with a specified name. -
ofSet
Create a newGValuefor a set value. -
ofSet
Create a newGValuefor a set value with a specified name. -
ofVertex
Create a newGValuefor a vertex value. -
ofVertex
Create a newGValuefor a vertex value with a specified name. -
getFrom
If the object is aGValuethen get its value, otherwise return the object as-is. -
valueInstanceOf
-
ensureGValues
-
resolveToValues
-
containsGValues
Tests if any of the objects are GValues. -
containsVariables
Tests if any of the objects are GValues or GValueConstantTraversal, and if so, if they are variables. -
valueOf
Takes an argument that is either aGValueor an object and if the former, returns the child object and if the latter returns the object itself.
-