Package org.apache.iceberg.variants
Interface VariantValue
-
- All Known Subinterfaces:
VariantArray,VariantObject,VariantPrimitive<T>
public interface VariantValueA variant value.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default VariantArrayasArray()Returns this value as aVariantArray.default VariantObjectasObject()Returns this value as aVariantObject.default VariantPrimitive<?>asPrimitive()Returns this value as aVariantPrimitive.static VariantValuefrom(VariantMetadata metadata, java.nio.ByteBuffer value)intsizeInBytes()Returns the serialized size in bytes of this value.PhysicalTypetype()Returns thePhysicalTypeof this value.intwriteTo(java.nio.ByteBuffer buffer, int offset)Writes this value to the buffer at the given offset, ignoring the buffer's position and limit.
-
-
-
Method Detail
-
type
PhysicalType type()
Returns thePhysicalTypeof this value.
-
sizeInBytes
int sizeInBytes()
Returns the serialized size in bytes of this value.
-
writeTo
int writeTo(java.nio.ByteBuffer buffer, int offset)Writes this value to the buffer at the given offset, ignoring the buffer's position and limit.
-
asPrimitive
default VariantPrimitive<?> asPrimitive()
Returns this value as aVariantPrimitive.- Throws:
java.lang.IllegalArgumentException- if the value is not a primitive
-
asObject
default VariantObject asObject()
Returns this value as aVariantObject.- Throws:
java.lang.IllegalArgumentException- if the value is not an object
-
asArray
default VariantArray asArray()
Returns this value as aVariantArray.- Throws:
java.lang.IllegalArgumentException- if the value is not an array
-
from
static VariantValue from(VariantMetadata metadata, java.nio.ByteBuffer value)
-
-