public class GenericVariantBuilder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GenericVariantBuilder.FieldEntry
Temporarily store the information of a field.
|
Constructor and Description |
---|
GenericVariantBuilder(boolean allowDuplicateKeys) |
Modifier and Type | Method and Description |
---|---|
int |
addKey(String key) |
void |
appendBinary(byte[] binary) |
void |
appendBoolean(boolean b) |
void |
appendDate(int daysSinceEpoch) |
void |
appendDecimal(BigDecimal d) |
void |
appendDouble(double d) |
void |
appendFloat(float f) |
void |
appendLong(long l) |
void |
appendNull() |
void |
appendString(String str) |
void |
appendTimestamp(long microsSinceEpoch) |
void |
appendTimestampNtz(long microsSinceEpoch) |
void |
appendVariant(GenericVariant v) |
void |
finishWritingArray(int start,
ArrayList<Integer> offsets) |
void |
finishWritingObject(int start,
ArrayList<GenericVariantBuilder.FieldEntry> fields) |
int |
getWritePos() |
static Variant |
parseJson(org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser parser,
boolean allowDuplicateKeys)
Similar
parseJson(String, boolean) , but takes a JSON parser instead of string input. |
static Variant |
parseJson(String json,
boolean allowDuplicateKeys)
Parse a JSON string as a Variant value.
|
Variant |
result() |
void |
shallowAppendVariant(GenericVariant v) |
byte[] |
valueWithoutMetadata() |
public static Variant parseJson(String json, boolean allowDuplicateKeys) throws IOException
IOException
- if any JSON parsing error happens.public static Variant parseJson(org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser parser, boolean allowDuplicateKeys) throws IOException
parseJson(String, boolean)
, but takes a JSON parser instead of string input.IOException
public Variant result()
public byte[] valueWithoutMetadata()
public void appendString(String str)
public void appendNull()
public void appendBoolean(boolean b)
public void appendLong(long l)
public void appendDouble(double d)
public void appendDecimal(BigDecimal d)
public void appendDate(int daysSinceEpoch)
public void appendTimestamp(long microsSinceEpoch)
public void appendTimestampNtz(long microsSinceEpoch)
public void appendFloat(float f)
public void appendBinary(byte[] binary)
public int addKey(String key)
public int getWritePos()
public void finishWritingObject(int start, ArrayList<GenericVariantBuilder.FieldEntry> fields)
public void appendVariant(GenericVariant v)
public void shallowAppendVariant(GenericVariant v)
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.