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(byte[] data) |
static FLValue |
fromData(FLSliceResult slice) |
static String |
getJSONForJSON5(String json5)
Converts valid JSON5 to JSON.
|
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`.
|
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(@Nullable FLSliceResult slice)
@Nullable public static String getJSONForJSON5(@Nullable String json5) throws LiteCoreException
json5
- StringLiteCoreException
- on parse failure@NonNull public static FLValue fromData(@NonNull byte[] data)
public int getType()
public boolean isNumber()
public boolean isInteger()
public boolean isUnsigned()
public boolean isDouble()
@Nullable public String toStr()
@Nullable public String toJSON()
@Nullable public String toJSON5()
@NonNull public byte[] asData()
public boolean asBool()
public long asInt()
public long asUnsigned()
public float asFloat()
public double asDouble()
@NonNull public String asString()
@NonNull public <T> List<T> asTypedArray()
@NonNull public FLDict asFLDict()
@NonNull public Map<String,Object> asDict()
@Nullable public Object asObject()