Package org.apache.iceberg.variants
Interface VariantValue
- All Known Subinterfaces:
VariantArray
,VariantObject
,VariantPrimitive<T>
- All Known Implementing Classes:
ShreddedObject
public interface VariantValue
A variant value.
-
Method Summary
Modifier and TypeMethodDescriptiondefault VariantArray
asArray()
Returns this value as aVariantArray
.default VariantObject
asObject()
Returns this value as aVariantObject
.default VariantPrimitive<?>
Returns this value as aVariantPrimitive
.int
Returns the serialized size in bytes of this value.type()
Returns thePhysicalType
of this value.int
writeTo
(ByteBuffer buffer, int offset) Writes this value to the buffer at the given offset, ignoring the buffer's position and limit.
-
Method Details
-
type
PhysicalType type()Returns thePhysicalType
of this value. -
sizeInBytes
int sizeInBytes()Returns the serialized size in bytes of this value. -
writeTo
Writes this value to the buffer at the given offset, ignoring the buffer's position and limit. -
asPrimitive
Returns this value as aVariantPrimitive
.- Throws:
IllegalArgumentException
- if the value is not a primitive
-
asObject
Returns this value as aVariantObject
.- Throws:
IllegalArgumentException
- if the value is not an object
-
asArray
Returns this value as aVariantArray
.- Throws:
IllegalArgumentException
- if the value is not an array
-