Modifier and Type | Class and Description |
---|---|
static class |
GenericVariant.ObjectField
Variant object field.
|
Constructor and Description |
---|
GenericVariant(byte[] value,
byte[] metadata) |
Modifier and Type | Method and Description |
---|---|
int |
arraySize() |
Variant |
copy()
Returns a copy of the variant.
|
boolean |
equals(Object o) |
static Variant |
fromJson(String json) |
byte[] |
getBinary() |
boolean |
getBoolean() |
BigDecimal |
getDecimal() |
int |
getDictionaryIdAtIndex(int index) |
double |
getDouble() |
GenericVariant |
getElementAtIndex(int index) |
GenericVariant.ObjectField |
getFieldAtIndex(int index) |
GenericVariant |
getFieldByKey(String key) |
float |
getFloat() |
long |
getLong() |
String |
getString() |
GenericVariantUtil.Type |
getType() |
int |
getTypeInfo() |
int |
hashCode() |
byte[] |
metadata()
Returns the variant metadata.
|
int |
objectSize() |
int |
pos() |
byte[] |
rawValue() |
long |
sizeInBytes()
Returns the size of the variant in bytes.
|
String |
toJson()
Parses the variant to json.
|
String |
toJson(java.time.ZoneId zoneId) |
String |
toString() |
byte[] |
value()
Returns the variant value.
|
Object |
variantGet(String path)
Extracts a sub-variant value according to a path which start with a `$`.
|
public byte[] value()
Variant
public byte[] rawValue()
public byte[] metadata()
Variant
public int pos()
public String toJson()
Variant
public String toJson(java.time.ZoneId zoneId)
public Object variantGet(String path)
Variant
access object's field: `$.key` or `$['key']` or `$["key"]`.
access array's first elem: `$.array[0]`
variantGet
in interface Variant
public long sizeInBytes()
Variant
sizeInBytes
in interface Variant
public Variant copy()
Variant
public boolean getBoolean()
public long getLong()
public double getDouble()
public BigDecimal getDecimal()
public float getFloat()
public byte[] getBinary()
public String getString()
public int getTypeInfo()
public GenericVariantUtil.Type getType()
public int objectSize()
public GenericVariant getFieldByKey(String key)
public GenericVariant.ObjectField getFieldAtIndex(int index)
public int getDictionaryIdAtIndex(int index)
public int arraySize()
public GenericVariant getElementAtIndex(int index)
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.