public final class PrimitiveType extends Type
Modifier and Type | Class and Description |
---|---|
static class |
PrimitiveType.PrimitiveTypeName
Supported Primitive types
|
static interface |
PrimitiveType.PrimitiveTypeNameConverter<T,E extends Exception> |
Type.Repetition
Constructor and Description |
---|
PrimitiveType(Type.Repetition repetition,
PrimitiveType.PrimitiveTypeName primitive,
int length,
String name) |
PrimitiveType(Type.Repetition repetition,
PrimitiveType.PrimitiveTypeName primitive,
int length,
String name,
OriginalType originalType) |
PrimitiveType(Type.Repetition repetition,
PrimitiveType.PrimitiveTypeName primitive,
String name) |
PrimitiveType(Type.Repetition repetition,
PrimitiveType.PrimitiveTypeName primitive,
String name,
OriginalType originalType) |
Modifier and Type | Method and Description |
---|---|
void |
accept(TypeVisitor visitor)
Visits this type with the given visitor
|
protected boolean |
containsPath(String[] path,
int depth) |
<T> T |
convert(List<GroupType> path,
TypeConverter<T> converter) |
DecimalMetadata |
getDecimalMetadata() |
int |
getMaxDefinitionLevel(String[] path,
int i) |
int |
getMaxRepetitionLevel(String[] path,
int i) |
protected List<String[]> |
getPaths(int depth) |
PrimitiveType.PrimitiveTypeName |
getPrimitiveTypeName() |
Type |
getType(String[] path,
int i) |
int |
getTypeLength() |
boolean |
isPrimitive() |
protected boolean |
typeEquals(Type other) |
protected int |
typeHashCode() |
protected Type |
union(Type toMerge) |
void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
asGroupType, asPrimitiveType, equals, getName, getOriginalType, getRepetition, hashCode, isRepetition, toString
public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name)
repetition
- OPTIONAL, REPEATED, REQUIREDprimitive
- STRING, INT64, ...name
- the name of the typepublic PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name)
repetition
- OPTIONAL, REPEATED, REQUIREDprimitive
- STRING, INT64, ...length
- the length if the type is FIXED_LEN_BYTE_ARRAY, 0 otherwise (XXX)name
- the name of the typepublic PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name, OriginalType originalType)
repetition
- OPTIONAL, REPEATED, REQUIREDprimitive
- STRING, INT64, ...name
- the name of the typeoriginalType
- (optional) the original type to help with cross schema convertion (LIST, MAP, ...)public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name, OriginalType originalType)
repetition
- OPTIONAL, REPEATED, REQUIREDprimitive
- STRING, INT64, ...name
- the name of the typelength
- the length if the type is FIXED_LEN_BYTE_ARRAY, 0 otherwise (XXX)originalType
- (optional) the original type to help with cross schema conversion (LIST, MAP, ...)public PrimitiveType.PrimitiveTypeName getPrimitiveTypeName()
public int getTypeLength()
public DecimalMetadata getDecimalMetadata()
public boolean isPrimitive()
isPrimitive
in class Type
public void accept(TypeVisitor visitor)
public void writeToStringBuilder(StringBuilder sb, String indent)
writeToStringBuilder
in class Type
sb
- the StringBuilder to write itself toprotected boolean typeEquals(Type other)
typeEquals
in class Type
protected int typeHashCode()
typeHashCode
in class Type
public int getMaxRepetitionLevel(String[] path, int i)
getMaxRepetitionLevel
in class Type
public int getMaxDefinitionLevel(String[] path, int i)
getMaxDefinitionLevel
in class Type
public <T> T convert(List<GroupType> path, TypeConverter<T> converter)
converter
- logic to convert the treeprotected boolean containsPath(String[] path, int depth)
containsPath
in class Type
Copyright © 2015. All rights reserved.