public class FLValue extends Object
Constructor and Description |
---|
FLValue(long handle) |
Modifier and Type | Method and Description |
---|---|
List<Object> |
asArray() |
boolean |
asBool()
Returns a value coerced to boolean.
|
byte[] |
asData()
Returns the exact contents of a data value, or null for all other types.
|
Map<String,Object> |
asDict()
If a FLValue represents an array, returns it cast to FLDict, else nullptr.
|
double |
asDouble()
Returns a value coerced to a 64-bit floating point number.
|
FLDict |
asFLDict()
Returns the contents as a dictionary.
|
float |
asFloat()
Returns a value coerced to a 32-bit floating point number.
|
long |
asInt()
Returns a value coerced to an integer.
|
Object |
asObject()
Return an object of the appropriate type.
|
String |
asString()
Returns the exact contents of a string value, or null for all other types.
|
<T> List<T> |
asTypedArray() |
long |
asUnsigned()
Returns a value coerced to an unsigned integer.
|
static FLValue |
fromData(AllocSlice slice) |
static FLValue |
fromData(byte[] data) |
int |
getType()
Returns the data type of an arbitrary Value.
|
boolean |
isDouble()
Is this a 64-bit floating-point value?
|
boolean |
isInteger()
Is this value an integer?
|
boolean |
isNumber()
Is this value a number?
|
boolean |
isUnsigned()
Returns true if the value is non-nullptr and represents an _unsigned_ integer that can only
be represented natively as a `uint64_t`.
|
static String |
json5ToJson(String json5)
Converts valid JSON5 to JSON.
|
String |
toJSON()
Returns the json representation.
|
String |
toJSON5()
Returns the string representation.
|
static Object |
toObject(FLValue flValue) |
String |
toStr()
Returns the string representation.
|
@Nullable public static FLValue fromData(AllocSlice slice)
@Nullable public static String json5ToJson(String json5) throws LiteCoreException
json5
- StringLiteCoreException
- on parse failure@NonNull public static FLValue fromData(byte[] data)
public int getType()
public boolean isNumber()
public boolean isInteger()
public boolean isUnsigned()
public boolean isDouble()
public String toStr()
public String toJSON()
public String toJSON5()
public byte[] asData()
public boolean asBool()
public long asInt()
public long asUnsigned()
public float asFloat()
public double asDouble()
public String asString()
public <T> List<T> asTypedArray()
public FLDict asFLDict()
public Map<String,Object> asDict()
public Object asObject()