public static class FlexBuffers.Reference extends Object
| Modifier and Type | Method and Description |
|---|---|
FlexBuffers.Blob |
asBlob()
Returns element as a
FlexBuffers.Blob |
boolean |
asBoolean()
Returns element as a boolean
|
double |
asFloat()
Returns element as 64-bit integer.
|
int |
asInt()
Returns element as 32-bit integer.
|
FlexBuffers.Key |
asKey()
Returns element as a
FlexBuffers.Key |
long |
asLong()
Returns element as 64-bit integer.
|
FlexBuffers.Map |
asMap()
Returns element as a
FlexBuffers.Map |
String |
asString()
Returns element as a `String`
|
long |
asUInt()
Returns element as unsigned 64-bit integer.
|
FlexBuffers.Vector |
asVector()
Returns element as a
FlexBuffers.Vector |
int |
getType()
Return element type
|
boolean |
isBlob()
Checks whether the element type is a blob
|
boolean |
isBoolean()
Checks whether the element is boolean type
|
boolean |
isFloat()
Checks whether the element type is float
|
boolean |
isInt()
Checks whether the element type is signed integer
|
boolean |
isIntOrUInt()
Checks whether the element type is signed or unsigned integers
|
boolean |
isKey()
Checks whether the element type is key
|
boolean |
isMap()
Checks whether the element type is a map
|
boolean |
isNull()
Checks whether the element is null type
|
boolean |
isNumeric()
Checks whether the element type is numeric (signed/unsigned integers and floats)
|
boolean |
isString()
Checks whether the element type is string
|
boolean |
isTypedVector()
Checks whether the element type is typed vector
|
boolean |
isUInt()
Checks whether the element type is signed integer
|
boolean |
isVector()
Checks whether the element type is vector
|
String |
toString()
Returns text representation of the element (JSON)
|
public FlexBuffers.Blob asBlob()
FlexBuffers.BlobFlexBuffers.Blob or empty FlexBuffers.Blob if failpublic boolean asBoolean()
If element type is not boolean, it will be casted to integer and compared against 0
public double asFloat()
For vector element, it will return size of the vector
For String element, it will type to be parsed as integer
public int asInt()
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
public FlexBuffers.Key asKey()
FlexBuffers.KeyFlexBuffers.Key.empty() if element is not a keypublic long asLong()
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
public FlexBuffers.Map asMap()
FlexBuffers.MapFlexBuffers.Map or empty FlexBuffers.Map if failpublic String asString()
public long asUInt()
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
public FlexBuffers.Vector asVector()
FlexBuffers.VectorFlexBuffers.Vector or empty FlexBuffers.Vector if failpublic int getType()
public boolean isBlob()
public boolean isBoolean()
public boolean isFloat()
public boolean isInt()
public boolean isIntOrUInt()
public boolean isKey()
public boolean isMap()
public boolean isNull()
public boolean isNumeric()
public boolean isString()
public boolean isTypedVector()
public boolean isUInt()
public boolean isVector()