public abstract class Type extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Type.Repetition
Constraint on the repetition of a field
|
Constructor and Description |
---|
Type(String name,
Type.Repetition repetition) |
Type(String name,
Type.Repetition repetition,
OriginalType originalType) |
Modifier and Type | Method and Description |
---|---|
abstract void |
accept(TypeVisitor visitor)
Visits this type with the given visitor
|
GroupType |
asGroupType() |
PrimitiveType |
asPrimitiveType() |
protected abstract boolean |
containsPath(String[] path,
int depth) |
boolean |
equals(Object other) |
protected abstract int |
getMaxDefinitionLevel(String[] path,
int i) |
protected abstract int |
getMaxRepetitionLevel(String[] path,
int i) |
String |
getName() |
OriginalType |
getOriginalType() |
protected abstract List<String[]> |
getPaths(int depth) |
Type.Repetition |
getRepetition() |
protected abstract Type |
getType(String[] path,
int i) |
int |
hashCode() |
abstract boolean |
isPrimitive() |
boolean |
isRepetition(Type.Repetition rep) |
String |
toString() |
protected abstract boolean |
typeEquals(Type other) |
protected abstract int |
typeHashCode() |
protected abstract Type |
union(Type toMerge) |
abstract void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
public Type(String name, Type.Repetition repetition)
name
- the name of the typerepetition
- OPTIONAL, REPEATED, REQUIREDpublic Type(String name, Type.Repetition repetition, OriginalType originalType)
name
- the name of the typerepetition
- OPTIONAL, REPEATED, REQUIREDoriginalType
- (optional) the original type to help with cross schema convertion (LIST, MAP, ...)public String getName()
public boolean isRepetition(Type.Repetition rep)
rep
- public Type.Repetition getRepetition()
public OriginalType getOriginalType()
public abstract boolean isPrimitive()
public GroupType asGroupType()
ClassCastException
- if notpublic PrimitiveType asPrimitiveType()
ClassCastException
- if notpublic abstract void writeToStringBuilder(StringBuilder sb, String indent)
sb
- the StringBuilder to write itself tocurrent
- indentation levelpublic abstract void accept(TypeVisitor visitor)
visitor
- the visitor to visit this typeprotected abstract int typeHashCode()
protected abstract boolean typeEquals(Type other)
protected abstract int getMaxRepetitionLevel(String[] path, int i)
protected abstract int getMaxDefinitionLevel(String[] path, int i)
protected abstract boolean containsPath(String[] path, int depth)
protected abstract Type union(Type toMerge)
toMerge
- the type to merge into this oneCopyright © 2015. All rights reserved.