FlatBuffers
An open source project by FPL.
com.google.flatbuffers.FlexBuffers.Reference Class Reference

Represents an generic element in the buffer. More...

Detailed Description

Represents an generic element in the buffer.

Public Member Functions

Blob asBlob ()
 Returns element as a Blob. More...
 
boolean asBoolean ()
 Returns element as a boolean. More...
 
double asFloat ()
 Returns element as 64-bit integer. More...
 
int asInt ()
 Returns element as 32-bit integer. More...
 
Key asKey ()
 Returns element as a Key. More...
 
long asLong ()
 Returns element as 64-bit integer. More...
 
Map asMap ()
 Returns element as a Map. More...
 
String asString ()
 Returns element as a String More...
 
long asUInt ()
 Returns element as unsigned 64-bit integer. More...
 
Vector asVector ()
 Returns element as a Vector. More...
 
int getType ()
 Return element type. More...
 
boolean isBlob ()
 Checks whether the element type is a blob. More...
 
boolean isBoolean ()
 Checks whether the element is boolean type. More...
 
boolean isFloat ()
 Checks whether the element type is float. More...
 
boolean isInt ()
 Checks whether the element type is signed integer. More...
 
boolean isIntOrUInt ()
 Checks whether the element type is signed or unsigned integers. More...
 
boolean isKey ()
 Checks whether the element type is key. More...
 
boolean isMap ()
 Checks whether the element type is a map. More...
 
boolean isNull ()
 Checks whether the element is null type. More...
 
boolean isNumeric ()
 Checks whether the element type is numeric (signed/unsigned integers and floats) More...
 
boolean isString ()
 Checks whether the element type is string. More...
 
boolean isTypedVector ()
 Checks whether the element type is typed vector. More...
 
boolean isUInt ()
 Checks whether the element type is signed integer. More...
 
boolean isVector ()
 Checks whether the element type is vector. More...
 
String toString ()
 Returns text representation of the element (JSON) More...
 

Member Function Documentation

◆ asBlob()

Blob com.google.flatbuffers.FlexBuffers.Reference.asBlob ( )
inline

Returns element as a Blob.

Returns
element as Blob or empty Blob if fail

◆ asBoolean()

boolean com.google.flatbuffers.FlexBuffers.Reference.asBoolean ( )
inline

Returns element as a boolean.

If element type is not boolean, it will be casted to integer and compared against 0

Returns
element as boolean

◆ asFloat()

double com.google.flatbuffers.FlexBuffers.Reference.asFloat ( )
inline

Returns element as 64-bit integer.

For vector element, it will return size of the vector

For String element, it will type to be parsed as integer

Returns
64-bit integer or 0 if fail to convert element to long.

◆ asInt()

int com.google.flatbuffers.FlexBuffers.Reference.asInt ( )
inline

Returns element as 32-bit integer.

For vector element, it will return size of the vector

For String element, it will type to be parsed as integer

Unsigned elements will become negative

Float elements will be casted to integer

Returns
32-bit integer or 0 if fail to convert element to integer.

◆ asKey()

Key com.google.flatbuffers.FlexBuffers.Reference.asKey ( )
inline

Returns element as a Key.

Returns
key or Key#empty() if element is not a key

◆ asLong()

long com.google.flatbuffers.FlexBuffers.Reference.asLong ( )
inline

Returns element as 64-bit integer.

For vector element, it will return size of the vector

For String element, it will type to be parsed as integer

Unsigned elements will become negative

Float elements will be casted to integer

Returns
64-bit integer or 0 if fail to convert element to long.

◆ asMap()

Map com.google.flatbuffers.FlexBuffers.Reference.asMap ( )
inline

Returns element as a Map.

Returns
element as Map or empty Map if fail

◆ asString()

String com.google.flatbuffers.FlexBuffers.Reference.asString ( )
inline

Returns element as a String

Returns
element as String or empty String if fail

◆ asUInt()

long com.google.flatbuffers.FlexBuffers.Reference.asUInt ( )
inline

Returns element as unsigned 64-bit integer.

For vector element, it will return size of the vector

For String element, it will type to be parsed as integer

Negative signed elements will become unsigned counterpart

Float elements will be casted to integer

Returns
64-bit integer or 0 if fail to convert element to integer.

◆ asVector()

Vector com.google.flatbuffers.FlexBuffers.Reference.asVector ( )
inline

Returns element as a Vector.

Returns
element as Vector or empty Vector if fail

◆ getType()

int com.google.flatbuffers.FlexBuffers.Reference.getType ( )
inline

Return element type.

Returns
element type as integer

◆ isBlob()

boolean com.google.flatbuffers.FlexBuffers.Reference.isBlob ( )
inline

Checks whether the element type is a blob.

Returns
true if a blob type

◆ isBoolean()

boolean com.google.flatbuffers.FlexBuffers.Reference.isBoolean ( )
inline

Checks whether the element is boolean type.

Returns
true if boolean type

◆ isFloat()

boolean com.google.flatbuffers.FlexBuffers.Reference.isFloat ( )
inline

Checks whether the element type is float.

Returns
true if a float type

◆ isInt()

boolean com.google.flatbuffers.FlexBuffers.Reference.isInt ( )
inline

Checks whether the element type is signed integer.

Returns
true if a signed integer type

◆ isIntOrUInt()

boolean com.google.flatbuffers.FlexBuffers.Reference.isIntOrUInt ( )
inline

Checks whether the element type is signed or unsigned integers.

Returns
true if an integer type

◆ isKey()

boolean com.google.flatbuffers.FlexBuffers.Reference.isKey ( )
inline

Checks whether the element type is key.

Returns
true if a key type

◆ isMap()

boolean com.google.flatbuffers.FlexBuffers.Reference.isMap ( )
inline

Checks whether the element type is a map.

Returns
true if a map type

◆ isNull()

boolean com.google.flatbuffers.FlexBuffers.Reference.isNull ( )
inline

Checks whether the element is null type.

Returns
true if null type

◆ isNumeric()

boolean com.google.flatbuffers.FlexBuffers.Reference.isNumeric ( )
inline

Checks whether the element type is numeric (signed/unsigned integers and floats)

Returns
true if numeric type

◆ isString()

boolean com.google.flatbuffers.FlexBuffers.Reference.isString ( )
inline

Checks whether the element type is string.

Returns
true if a string type

◆ isTypedVector()

boolean com.google.flatbuffers.FlexBuffers.Reference.isTypedVector ( )
inline

Checks whether the element type is typed vector.

Returns
true if a typed vector type

◆ isUInt()

boolean com.google.flatbuffers.FlexBuffers.Reference.isUInt ( )
inline

Checks whether the element type is signed integer.

Returns
true if a signed integer type

◆ isVector()

boolean com.google.flatbuffers.FlexBuffers.Reference.isVector ( )
inline

Checks whether the element type is vector.

Returns
true if a vector type

◆ toString()

String com.google.flatbuffers.FlexBuffers.Reference.toString ( )
inline

Returns text representation of the element (JSON)

Returns
String containing text representation of the element

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