Class Result
java.lang.Object
org.apache.tinkerpop.gremlin.driver.Result
A
Result represents a result value from the server-side Iterator of results. This would be
one item from that result set. This class provides methods for coercing the result Object to an
expected type.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TGets the result item by casting it to the specifiedClass.booleanGets the result item by coercing it to anboolean.bytegetByte()Gets the result item by coercing it to anbyte.doubleGets the result item by coercing it to andouble.getEdge()Gets the result item by casting it to anEdge.Gets the result item by casting it to anElement.floatgetFloat()Gets the result item by coercing it to anfloat.intgetInt()Gets the result item by coercing it to anint.longgetLong()Gets the result item by coercing it to anlong.Gets the result item.getPath()Gets the result item by casting it to aPath.<V> Property<V>Gets the result item by casting it to aProperty.shortgetShort()Gets the result item by coercing it to anshort.Gets the result item by coercing it to aStringviatoString().Gets the result item by casting it to aVertex.<V> VertexProperty<V>Gets the result item by casting it to aVertexProperty.booleanisNull()Determines if the result item is null or not.toString()
-
Constructor Details
-
Result
Constructs a "result" from data found inResponseResult.getData().
-
-
Method Details
-
getString
Gets the result item by coercing it to aStringviatoString(). -
getInt
public int getInt()Gets the result item by coercing it to anint.- Throws:
NumberFormatException- if the value is not parsable as anint.
-
getByte
public byte getByte()Gets the result item by coercing it to anbyte.- Throws:
NumberFormatException- if the value is not parsable as anbyte.
-
getShort
public short getShort()Gets the result item by coercing it to anshort.- Throws:
NumberFormatException- if the value is not parsable as anshort.
-
getLong
public long getLong()Gets the result item by coercing it to anlong.- Throws:
NumberFormatException- if the value is not parsable as anlong.
-
getFloat
public float getFloat()Gets the result item by coercing it to anfloat.- Throws:
NumberFormatException- if the value is not parsable as anfloat.
-
getDouble
public double getDouble()Gets the result item by coercing it to andouble.- Throws:
NumberFormatException- if the value is not parsable as andouble.
-
getBoolean
public boolean getBoolean()Gets the result item by coercing it to anboolean.- Throws:
NumberFormatException- if the value is not parsable as anboolean.
-
isNull
public boolean isNull()Determines if the result item is null or not. This is often a good check prior to calling other methods to get the object as they could throw an unexpectedNullPointerExceptionif the result item isnull. -
getVertex
Gets the result item by casting it to aVertex. -
getEdge
Gets the result item by casting it to anEdge. -
getElement
Gets the result item by casting it to anElement. -
getPath
Gets the result item by casting it to aPath. -
getProperty
Gets the result item by casting it to aProperty. -
getVertexProperty
Gets the result item by casting it to aVertexProperty. -
get
Gets the result item by casting it to the specifiedClass. -
getObject
Gets the result item. -
toString
-