Class Types.Builder<THIS extends Types.Builder,P>
- Type Parameters:
P- The type that this builder will return fromnamed(String)when the type is built.
- Direct Known Subclasses:
Types.BaseGroupBuilder,Types.BaseListBuilder,Types.BaseMapBuilder,Types.BasePrimitiveBuilder
- Enclosing class:
- Types
Type objects.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Type.IDprotected LogicalTypeAnnotationprotected booleanprotected final Pprotected Type.Repetition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionas(LogicalTypeAnnotation type) Adds a type annotation (LogicalTypeAnnotation) to the type being built.as(OriginalType type) Deprecated.protected abstract Typeprotected OriginalTypeid(int id) adds an id annotation to the type being built.Builds aTypeand returns the parent builder, if given, or theTypethat was built.protected final THISrepetition(Type.Repetition repetition) protected abstract THISself()
-
Field Details
-
parent
-
returnClass
-
repetition
-
logicalTypeAnnotation
-
id
-
newLogicalTypeSet
protected boolean newLogicalTypeSet
-
-
Constructor Details
-
Builder
Construct a type builder that returns a "parent" object when the builder is finished. Theparentwill be returned bynamed(String)so that builders can be chained.- Parameters:
parent- a non-null object to return fromnamed(String)
-
Builder
Construct a type builder that returns theTypethat was built when the builder is finished. ThereturnClassmust be the expectedTypeclass.- Parameters:
returnClass- aTypeto return fromnamed(String)
-
-
Method Details
-
self
-
repetition
-
as
Deprecated.useas(LogicalTypeAnnotation)with the corresponding logical type insteadAdds a type annotation (OriginalType) to the type being built.Type annotations are used to extend the types that parquet can store, by specifying how the primitive types should be interpreted. This keeps the set of primitive types to a minimum and reuses parquet's efficient encodings. For example, strings are stored as byte arrays (binary) with a UTF8 annotation.
- Parameters:
type- anOriginalType- Returns:
- this builder for method chaining
-
as
Adds a type annotation (LogicalTypeAnnotation) to the type being built.Type annotations are used to extend the types that parquet can store, by specifying how the primitive types should be interpreted. This keeps the set of primitive types to a minimum and reuses parquet's efficient encodings. For example, strings are stored as byte arrays (binary) with a UTF8 annotation.
- Parameters:
type- an{@link LogicalTypeAnnotation}- Returns:
- this builder for method chaining
-
id
adds an id annotation to the type being built.ids are used to capture the original id when converting from models using ids (thrift, protobufs)
- Parameters:
id- the id of the field- Returns:
- this builder for method chaining
-
build
-
named
Builds aTypeand returns the parent builder, if given, or theTypethat was built. If returning a parent object that is a GroupBuilder, the constructed type will be added to it as a field.Note: Any configuration for this type builder should be done before calling this method.
- Parameters:
name- a name for the constructed type- Returns:
- the parent
GroupBuilderor the constructedType
-
getOriginalType
-
as(LogicalTypeAnnotation)with the corresponding logical type instead