NebulaGraph Java Client 5.0.0
Loading...
Searching...
No Matches
ValueWrapper Class Reference

Public Member Functions

 ValueWrapper (Object value, ColumnType type)
 
ColumnType getDataType ()
 
String getDataTypeString ()
 
Object getValue ()
 get the Object value
 
boolean isNull ()
 if the value is null
 
boolean isBoolean ()
 check if the Value is Boolean type
 
boolean isLong ()
 check if the Value is Long type
 
boolean isInt ()
 check if the Value is Int type
 
boolean isFloat ()
 check if the Value is Float type
 
boolean isDouble ()
 check if the Value is Double type
 
boolean isString ()
 check if the Value is String type
 
boolean isList ()
 check if the Value is List type
 
boolean isNode ()
 check if the Value is Node type
 
boolean isEdge ()
 check if the Value is Edge type
 
boolean isLocalTime ()
 check if the Value is Local Time type
 
boolean isZonedTime ()
 check if the Value is Zoned Time type
 
boolean isLocalDateTime ()
 check if the Value is Local Datetime type
 
boolean isZonedDateTime ()
 check if the Value is Zoned Datetime type
 
boolean isDate ()
 check if the Value is Date type
 
boolean isRecord ()
 check if the Value is Record type
 
boolean isDuration ()
 check if the Value is Duration type
 
boolean isPath ()
 check if the Value is Path type
 
boolean isDecimal ()
 check if the Value is Decimal type
 
boolean asBoolean () throws InvalidValueException
 Convert the original Value to boolean.
 
int asInt () throws InvalidValueException
 Convert the original int8/uint8/int16/uint16/int32/uint32 Value to int.
 
long asLong () throws InvalidValueException
 Convert the original int64/uint64 Value to long.
 
String asString () throws InvalidValueException
 Convert the original data type Value to String.
 
float asFloat () throws InvalidValueException
 Convert the original Value to float.
 
double asDouble () throws InvalidValueException
 Convert the original Value to double.
 
List< ValueWrapperasList () throws InvalidValueException
 Convert the original Value to list.
 
Node asNode () throws InvalidValueException
 Convert the original Value to Node.
 
Edge asEdge () throws InvalidValueException
 Convert the original data Value to Edge.
 
LocalTime asLocalTime () throws InvalidValueException
 Convert the original data Value to LocalTime.
 
OffsetTime asZonedTime () throws InvalidValueException
 Convert the original data type Value to OffsetTime.
 
LocalDate asDate () throws InvalidValueException
 Convert the original data type Value to LocalDate.
 
LocalDateTime asLocalDateTime () throws InvalidValueException
 Convert the original data Value to LocalDateTime.
 
ZonedDateTime asZonedDateTime () throws InvalidValueException
 Convert the original data Value to ZonedDateTime.
 
NDuration asDuration () throws InvalidValueException
 Convert the original data type Value to NDuration.
 
NRecord asRecord () throws InvalidValueException
 Convert the original data type Value to NRecord.
 
Path asPath () throws InvalidValueException
 Convert the original data type Value to Path.
 
BigDecimal asDecimal () throws InvalidValueException
 Convert the original data type Value to BigDecimal.
 
EmbeddingVector asVector () throws InvalidValueException
 Convert the original data type Value to Vector.
 
boolean equals (Object o)
 
int hashCode ()
 
String toString ()
 Convert Value to String format.
 

Detailed Description

Definition at line 42 of file ValueWrapper.java.

Constructor & Destructor Documentation

◆ ValueWrapper()

ValueWrapper ( Object  value,
ColumnType  type 
)

Definition at line 54 of file ValueWrapper.java.

Member Function Documentation

◆ asBoolean()

boolean asBoolean ( ) throws InvalidValueException

Convert the original Value to boolean.

Returns
boolean value
Exceptions
InvalidValueExceptionif the value type is not bool

Definition at line 311 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asDate()

LocalDate asDate ( ) throws InvalidValueException

Convert the original data type Value to LocalDate.

Returns
LocalDate value
Exceptions
InvalidValueExceptionif the value type is not date

Definition at line 483 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asDecimal()

BigDecimal asDecimal ( ) throws InvalidValueException

Convert the original data type Value to BigDecimal.

Returns
BigDecimal
Exceptions
InvalidValueExceptionif the value type is not decimal

Definition at line 567 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asDouble()

double asDouble ( ) throws InvalidValueException

Convert the original Value to double.

Returns
double value
Exceptions
InvalidValueExceptionif the value type is not double

Definition at line 397 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asDuration()

NDuration asDuration ( ) throws InvalidValueException

Convert the original data type Value to NDuration.

Returns
NDuration
Exceptions
InvalidValueExceptionif the value type is not duration

Definition at line 525 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asEdge()

Edge asEdge ( ) throws InvalidValueException

Convert the original data Value to Edge.

Returns
Edge value
Exceptions
InvalidValueExceptionif the value type is not edge

Definition at line 439 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asFloat()

float asFloat ( ) throws InvalidValueException

Convert the original Value to float.

Returns
float value
Exceptions
InvalidValueExceptionif the value type is not float

Definition at line 383 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asInt()

int asInt ( ) throws InvalidValueException

Convert the original int8/uint8/int16/uint16/int32/uint32 Value to int.

if the value in NebulaGraph is uint32 type and is negative, you can convert it to Long:

Integer.toUnsignedLong((int)value)

Returns
int value
Exceptions
InvalidValueExceptionif the value type is not int

Definition at line 330 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asList()

List< ValueWrapper > asList ( ) throws InvalidValueException

Convert the original Value to list.

Returns
list value
Exceptions
InvalidValueExceptionif the value type is not list

Definition at line 411 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asLocalDateTime()

LocalDateTime asLocalDateTime ( ) throws InvalidValueException

Convert the original data Value to LocalDateTime.

Returns
LocalDateTime
Exceptions
InvalidValueExceptionif the value type is not Local Datetime

Definition at line 497 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asLocalTime()

LocalTime asLocalTime ( ) throws InvalidValueException

Convert the original data Value to LocalTime.

Returns
LocalTime value
Exceptions
InvalidValueExceptionif the value type is not localtime

Definition at line 453 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asLong()

long asLong ( ) throws InvalidValueException

Convert the original int64/uint64 Value to long.

if the value in NebulaGraph is uint64 and is negative, you can convert it to BigInteger:

if (value >= 0) { return BigInteger.valueOf(value); } else { return BigInteger.valueOf((long)value & Long.MAX_VALUE).setBit(63); }

Returns
long
Exceptions
InvalidValueExceptionif the value type is not int64 or uint64

Definition at line 354 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asNode()

Node asNode ( ) throws InvalidValueException

Convert the original Value to Node.

Returns
Node value
Exceptions
InvalidValueExceptionif the value type is not node

Definition at line 425 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asPath()

Path asPath ( ) throws InvalidValueException

Convert the original data type Value to Path.

Returns
Path
Exceptions
InvalidValueExceptionif the value type is not Path

Definition at line 553 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asRecord()

NRecord asRecord ( ) throws InvalidValueException

Convert the original data type Value to NRecord.

Returns
NRecord
Exceptions
InvalidValueExceptionif the value type is not Record

Definition at line 539 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asString()

String asString ( ) throws InvalidValueException

Convert the original data type Value to String.

Returns
String value
Exceptions
InvalidValueExceptionif the value type is not string

Definition at line 369 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asVector()

EmbeddingVector asVector ( ) throws InvalidValueException

Convert the original data type Value to Vector.

Returns
Vector
Exceptions
InvalidValueExceptionif the value type is not Vector

Definition at line 581 of file ValueWrapper.java.

◆ asZonedDateTime()

ZonedDateTime asZonedDateTime ( ) throws InvalidValueException

Convert the original data Value to ZonedDateTime.

Returns
ZonedDateTime
Exceptions
InvalidValueExceptionif the value type is not Zoned Datetime

Definition at line 511 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ asZonedTime()

OffsetTime asZonedTime ( ) throws InvalidValueException

Convert the original data type Value to OffsetTime.

Returns
OffsetTime time with zone information
Exceptions
InvalidValueExceptionif the value type is not Zoned time

Definition at line 468 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ equals()

boolean equals ( Object  o)

Definition at line 590 of file ValueWrapper.java.

◆ getDataType()

ColumnType getDataType ( )

Definition at line 59 of file ValueWrapper.java.

◆ getDataTypeString()

String getDataTypeString ( )

Definition at line 63 of file ValueWrapper.java.

◆ getValue()

Object getValue ( )

get the Object value

Returns
Object

Definition at line 126 of file ValueWrapper.java.

◆ hashCode()

int hashCode ( )

Definition at line 602 of file ValueWrapper.java.

◆ isBoolean()

boolean isBoolean ( )

check if the Value is Boolean type

Returns
true if Value's type is COLUMN_TYPE_BOOL

Definition at line 144 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isDate()

boolean isDate ( )

check if the Value is Date type

Returns
true if Value's type is COLUMN_TYPE_DATE

Definition at line 265 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isDecimal()

boolean isDecimal ( )

check if the Value is Decimal type

Returns
true if Value's type is COLUMN_TYPE_DECIMAL

Definition at line 301 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isDouble()

boolean isDouble ( )

check if the Value is Double type

Returns
true if the type is COLUMN_TYPE_FLOAT64

Definition at line 184 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isDuration()

boolean isDuration ( )

check if the Value is Duration type

Returns
true if Value's type is COLUMN_TYPE_DURATION

Definition at line 283 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isEdge()

boolean isEdge ( )

check if the Value is Edge type

Returns
true if Value's type is COLUMN_TYPE_EDGE

Definition at line 220 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isFloat()

boolean isFloat ( )

check if the Value is Float type

Returns
true if Value's type is COLUMN_TYPE_FLOAT32

Definition at line 174 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isInt()

boolean isInt ( )

check if the Value is Int type

Returns
true if Value's type is COLUMN_TYPE_UINT8 or COLUMN_TYPE_INT8 or COLUMN_TYPE_UINT16 or COLUMN_TYPE_INT16 or COLUMN_TYPE_UINT32 or COLUMN_TYPE_INT32

Definition at line 163 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isList()

boolean isList ( )

check if the Value is List type

Returns
true if Value's type is COLUMN_TYPE_LIST

Definition at line 202 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isLocalDateTime()

boolean isLocalDateTime ( )

check if the Value is Local Datetime type

Returns
true if Value's type is COLUMN_TYPE_LOCALDATETIME

Definition at line 247 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isLocalTime()

boolean isLocalTime ( )

check if the Value is Local Time type

Returns
true if Value's type is COLUMN_TYPE_LOCALTIME

Definition at line 229 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isLong()

boolean isLong ( )

check if the Value is Long type

Returns
true if Value's type is COLUMN_TYPE_UINT64 or COLUMN_TYPE_INT64

Definition at line 153 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isNode()

boolean isNode ( )

check if the Value is Node type

Returns
true if Value's type is COLUMN_TYPE_NODE

Definition at line 211 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isNull()

boolean isNull ( )

if the value is null

Returns
true if value is null

Definition at line 135 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isPath()

boolean isPath ( )

check if the Value is Path type

Returns
true if Value's type is COLUMN_TYPE_PATH

Definition at line 292 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isRecord()

boolean isRecord ( )

check if the Value is Record type

Returns
true if Value's type is COLUMN_TYPE_RECORD

Definition at line 274 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isString()

boolean isString ( )

check if the Value is String type

Returns
true if Value's type is COLUMN_TYPE_STRING

Definition at line 193 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isZonedDateTime()

boolean isZonedDateTime ( )

check if the Value is Zoned Datetime type

Returns
true if Value's type is COLUMN_TYPE_ZONEDDATETIME

Definition at line 256 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ isZonedTime()

boolean isZonedTime ( )

check if the Value is Zoned Time type

Returns
true if Value's type is COLUMN_TYPE_ZONEDTIME

Definition at line 238 of file ValueWrapper.java.

+ Here is the caller graph for this function:

◆ toString()

String toString ( )

Convert Value to String format.

Returns
String

Definition at line 612 of file ValueWrapper.java.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: