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 int getType()
public boolean isNull()
public boolean isBoolean()
public boolean isNumeric()
public boolean isIntOrUInt()
public boolean isFloat()
public boolean isInt()
public boolean isUInt()
public boolean isString()
public boolean isKey()
public boolean isVector()
public boolean isTypedVector()
public boolean isMap()
public boolean isBlob()
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 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 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 double asFloat()
For vector element, it will return size of the vector
For String element, it will type to be parsed as integer
public FlexBuffers.Key asKey()
FlexBuffers.KeyFlexBuffers.Key.empty() if element is not a keypublic String asString()
public FlexBuffers.Map asMap()
FlexBuffers.MapFlexBuffers.Map or empty FlexBuffers.Map if failpublic FlexBuffers.Vector asVector()
FlexBuffers.VectorFlexBuffers.Vector or empty FlexBuffers.Vector if failpublic 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
Copyright © 2020. All rights reserved.