Class FileSchema.ElementBuilder
java.lang.Object
dev.hardwood.schema.FileSchema.ElementBuilder
- Enclosing class:
FileSchema
Declares the element of a
LIST, or the value of a MAP: a primitive, a nested
struct, a nested LIST, or a nested MAP. The declared node is named element
inside a list and value inside a map.-
Method Summary
Modifier and TypeMethodDescriptionvoidlist(RepetitionType repetition, Consumer<FileSchema.ElementBuilder> element) Declare a nestedLISTelement.voidmap(RepetitionType repetition, PhysicalType keyType, int keyTypeLength, LogicalType keyLogicalType, Consumer<FileSchema.ElementBuilder> value) Declare a nestedMAPelement whose key carries a logical type annotation, giving the fixed byte length of aFIXED_LEN_BYTE_ARRAYkey.voidmap(RepetitionType repetition, PhysicalType keyType, LogicalType keyLogicalType, Consumer<FileSchema.ElementBuilder> value) Declare a nestedMAPelement whose key carries a logical type annotation.voidmap(RepetitionType repetition, PhysicalType keyType, Consumer<FileSchema.ElementBuilder> value) Declare a nestedMAPelement.voidprimitive(PhysicalType type, RepetitionType repetition) Declare a primitive element.voidprimitive(PhysicalType type, RepetitionType repetition, int typeLength) Declare a primitive element, giving the fixed byte length of aFIXED_LEN_BYTE_ARRAYelement.voidprimitive(PhysicalType type, RepetitionType repetition, int typeLength, LogicalType logicalType) Declare a primitive element carrying a logical type annotation, giving the fixed byte length of aFIXED_LEN_BYTE_ARRAYelement.voidprimitive(PhysicalType type, RepetitionType repetition, LogicalType logicalType) Declare a primitive element carrying a logical type annotation.voidstruct(RepetitionType repetition, Consumer<FileSchema.StructBuilder> filler) Declare astructelement.
-
Method Details
-
primitive
Declare a primitive element.- Throws:
IllegalArgumentException- if the type isFIXED_LEN_BYTE_ARRAY(use the type-length overload)
-
primitive
Declare a primitive element, giving the fixed byte length of aFIXED_LEN_BYTE_ARRAYelement.- Throws:
IllegalArgumentException- iftypeLengthdoes not match the type
-
primitive
Declare a primitive element carrying a logical type annotation.- Throws:
IllegalArgumentException- if the annotation does not apply to the physical type
-
primitive
public void primitive(PhysicalType type, RepetitionType repetition, int typeLength, LogicalType logicalType) Declare a primitive element carrying a logical type annotation, giving the fixed byte length of aFIXED_LEN_BYTE_ARRAYelement.- Throws:
IllegalArgumentException- iftypeLengthdoes not match the type or the annotation does not apply to it
-
struct
Declare astructelement.- Throws:
IllegalArgumentException- if the struct has no fields
-
list
Declare a nestedLISTelement. -
map
public void map(RepetitionType repetition, PhysicalType keyType, Consumer<FileSchema.ElementBuilder> value) Declare a nestedMAPelement.- Throws:
IllegalArgumentException- if no value is declared
-
map
public void map(RepetitionType repetition, PhysicalType keyType, LogicalType keyLogicalType, Consumer<FileSchema.ElementBuilder> value) Declare a nestedMAPelement whose key carries a logical type annotation.- Throws:
IllegalArgumentException- if no value is declared or the annotation does not apply to the key's physical type
-
map
public void map(RepetitionType repetition, PhysicalType keyType, int keyTypeLength, LogicalType keyLogicalType, Consumer<FileSchema.ElementBuilder> value) Declare a nestedMAPelement whose key carries a logical type annotation, giving the fixed byte length of aFIXED_LEN_BYTE_ARRAYkey.- Throws:
IllegalArgumentException- if no value is declared,keyTypeLengthdoes not match the key's type, or the annotation does not apply to it
-