P
- The type that this builder will return from
named(String)
when the type is built.public abstract static class Types.Builder<T extends Types.Builder,P> extends Object
Type
objects.Modifier and Type | Field and Description |
---|---|
protected OriginalType |
originalType |
protected P |
parent |
protected Type.Repetition |
repetition |
protected Class<? extends P> |
returnClass |
Modifier | Constructor and Description |
---|---|
protected |
Builder(Class<P> returnClass)
Construct a type builder that returns the
Type that was built
when the builder is finished. |
protected |
Builder(P parent)
Construct a type builder that returns a "parent" object when the builder
is finished.
|
Modifier and Type | Method and Description |
---|---|
T |
as(OriginalType type)
Adds a type annotation (
OriginalType ) to the type being built. |
protected abstract Type |
build(String name) |
P |
named(String name)
Builds a
Type and returns the parent builder, if given, or the
Type that was built. |
protected T |
repetition(Type.Repetition repetition) |
protected abstract T |
self() |
protected final P parent
protected Type.Repetition repetition
protected OriginalType originalType
protected Builder(P parent)
parent
will be returned by
named(String)
so that builders can be chained.parent
- a non-null object to return from named(String)
protected Builder(Class<P> returnClass)
Type
that was built
when the builder is finished. The returnClass
must be the
expected Type
class.returnClass
- a Type
to return from named(String)
protected abstract T self()
protected final T repetition(Type.Repetition repetition)
public T as(OriginalType type)
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.
type
- an OriginalType
public P named(String name)
Type
and returns the parent builder, if given, or the
Type
that 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.
name
- a name for the constructed typeGroupBuilder
or the constructed Type
Copyright © 2015. All rights reserved.