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,
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) |
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) |
boolean |
isPrimitive() |
protected boolean |
typeEquals(Type other) |
protected int |
typeHashCode() |
void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
asGroupType, asPrimitiveType, equals, getName, getOriginalType, getRepetition, hashCode, isRepetition, toStringpublic PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name)
repetition - the OPTIONAL, REPEATED, REQUIREDprimitive - STRING, INT64, ...name - the name of the typepublic PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name, OriginalType originalType)
public PrimitiveType.PrimitiveTypeName getPrimitiveTypeName()
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 toprotected boolean typeEquals(Type other)
typeEquals in class Typeprotected int typeHashCode()
typeHashCode 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 © 2013. All Rights Reserved.