Package ai.velr
Class Cell
java.lang.Object
ai.velr.Cell
One value returned by a Velr result table.
Cells expose the storage class used by tabular query results. Primitive values can be read through type-specific accessors. JSON cells contain a UTF-8 JSON rendering of richer Cypher values such as lists, maps, nodes, relationships, and paths.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn this cell as a boolean.byte[]asBytes()Return the raw byte payload for text and JSON cells.doubleasDouble()Return this cell as a double.longasLong()Return this cell as a signed 64-bit integer.asObject()Convert this cell to a simple Java value.asString()Return this text or JSON cell as a string.static Cellbool(boolean value) Create a boolean cell.static CelldoubleValue(double value) Create a floating-point cell.static Cellint64(long value) Create a signed 64-bit integer cell.static Celljson(byte[] bytes) Create a JSON cell from UTF-8 bytes.static CellCreate a null cell.static Celltext(byte[] bytes) Create a text cell from UTF-8 bytes.toString()Return a string representation of the Java value.type()Return the cell kind.
-
Method Details
-
nullValue
Create a null cell.- Returns:
- null cell
-
bool
Create a boolean cell.- Parameters:
value- boolean value- Returns:
- boolean cell
-
int64
Create a signed 64-bit integer cell.- Parameters:
value- integer value- Returns:
- integer cell
-
doubleValue
Create a floating-point cell.- Parameters:
value- double value- Returns:
- double cell
-
text
Create a text cell from UTF-8 bytes.- Parameters:
bytes- UTF-8 text bytes- Returns:
- text cell
-
json
Create a JSON cell from UTF-8 bytes.- Parameters:
bytes- UTF-8 JSON bytes- Returns:
- JSON cell
-
type
Return the cell kind.- Returns:
- cell type
-
asBoolean
public boolean asBoolean()Return this cell as a boolean.- Returns:
- boolean value
- Throws:
VelrException- if this cell is notCellType.BOOL
-
asLong
public long asLong()Return this cell as a signed 64-bit integer.- Returns:
- integer value
- Throws:
VelrException- if this cell is notCellType.INT64
-
asDouble
public double asDouble()Return this cell as a double.- Returns:
- double value
- Throws:
VelrException- if this cell is notCellType.DOUBLE
-
asString
Return this text or JSON cell as a string.- Returns:
- UTF-8 decoded text or JSON
- Throws:
VelrException- if this cell is notCellType.TEXTorCellType.JSON
-
asBytes
public byte[] asBytes()Return the raw byte payload for text and JSON cells.For non-byte-backed cell types this returns an empty array.
- Returns:
- copied byte payload
-
asObject
Convert this cell to a simple Java value.Returns
null,Boolean,Long,Double, orString. JSON cells are returned as their canonical JSON string.- Returns:
- Java value
-
toString
Return a string representation of the Java value.
-