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.ID, 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)
Deprecated.
|
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) |
protected boolean |
equals(Type other) |
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() |
int |
hashCode() |
boolean |
isPrimitive() |
protected boolean |
typeEquals(Type other)
Deprecated.
|
protected int |
typeHashCode()
Deprecated.
|
protected Type |
union(Type toMerge) |
protected Type |
union(Type toMerge,
boolean strict) |
PrimitiveType |
withId(int id) |
void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
asGroupType, asPrimitiveType, eqOrBothNull, equals, getId, getName, getOriginalType, getRepetition, isRepetition, toStringpublic 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, ...)@Deprecated 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 withId(int id)
public PrimitiveType.PrimitiveTypeName getPrimitiveTypeName()
public int getTypeLength()
public DecimalMetadata getDecimalMetadata()
public boolean isPrimitive()
isPrimitive in class Typepublic void accept(TypeVisitor visitor)
public void writeToStringBuilder(StringBuilder sb, String indent)
writeToStringBuilder in class Typesb - the StringBuilder to write itself toindent - indentation level@Deprecated protected int typeHashCode()
typeHashCode in class Type@Deprecated protected boolean typeEquals(Type other)
typeEquals in class Typepublic int getMaxRepetitionLevel(String[] path, int i)
getMaxRepetitionLevel in class Typepublic int getMaxDefinitionLevel(String[] path, int i)
getMaxDefinitionLevel in class Typepublic <T> T convert(List<GroupType> path, TypeConverter<T> converter)
converter - logic to convert the treeprotected boolean containsPath(String[] path, int depth)
containsPath in class TypeCopyright © 2015 The Apache Software Foundation. All rights reserved.