public interface Variant
A Variant is encoded with 2 binary values, the value and the metadata.
The Variant Binary Encoding allows representation of semi-structured data (e.g. JSON) in a form that can be efficiently queried by path. The design is intended to allow efficient access to nested data even in the presence of very wide or deep structures.
| Modifier and Type | Field and Description |
|---|---|
static String |
METADATA |
static String |
VALUE |
| Modifier and Type | Method and Description |
|---|---|
Variant |
copy()
Returns a copy of the variant.
|
byte[] |
metadata()
Returns the variant metadata.
|
long |
sizeInBytes()
Returns the size of the variant in bytes.
|
String |
toJson()
Parses the variant to json.
|
byte[] |
value()
Returns the variant value.
|
Object |
variantGet(String path)
Extracts a sub-variant value according to a path which start with a `$`.
|
static final String METADATA
static final String VALUE
byte[] metadata()
byte[] value()
String toJson()
Object variantGet(String path)
access object's field: `$.key` or `$['key']` or `$["key"]`.
access array's first elem: `$.array[0]`
long sizeInBytes()
Variant copy()
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.