Package org.apache.iceberg.variants
Interface VariantValue
- All Known Subinterfaces:
VariantArray,VariantObject,VariantPrimitive<T>
- All Known Implementing Classes:
ShreddedObject,ValueArray
public interface VariantValue
A variant value.
-
Method Summary
Modifier and TypeMethodDescriptiondefault VariantArrayasArray()Returns this value as aVariantArray.default VariantObjectasObject()Returns this value as aVariantObject.default VariantPrimitive<?> Returns this value as aVariantPrimitive.static VariantValuefrom(VariantMetadata metadata, ByteBuffer value) intReturns the serialized size in bytes of this value.type()Returns thePhysicalTypeof this value.intwriteTo(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 thePhysicalTypeof 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
-
from
-