public abstract class Type extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Type.ID
represents a field ID
|
static class |
Type.Repetition
Constraint on the repetition of a field
|
| Constructor and Description |
|---|
Type(String name,
Type.Repetition repetition)
Deprecated.
|
Type(String name,
Type.Repetition repetition,
OriginalType originalType)
Deprecated.
|
| 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) |
protected boolean |
eqOrBothNull(Object o1,
Object o2) |
boolean |
equals(Object other) |
protected boolean |
equals(Type other) |
Type.ID |
getId() |
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)
Deprecated.
|
protected abstract int |
typeHashCode()
Deprecated.
|
protected abstract Type |
union(Type toMerge) |
protected abstract Type |
union(Type toMerge,
boolean strict) |
abstract Type |
withId(int id) |
abstract void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
@Deprecated public Type(String name, Type.Repetition repetition)
name - the name of the typerepetition - OPTIONAL, REPEATED, REQUIRED@Deprecated public 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 conversion (LIST, MAP, ...)public abstract Type withId(int id)
id - an integer idpublic String getName()
public boolean isRepetition(Type.Repetition rep)
rep - repetition level to testpublic Type.Repetition getRepetition()
public Type.ID getId()
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 toindent - indentation levelpublic abstract void accept(TypeVisitor visitor)
visitor - the visitor to visit this type@Deprecated protected abstract int typeHashCode()
@Deprecated protected abstract boolean typeEquals(Type other)
protected boolean equals(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 oneprotected abstract Type union(Type toMerge, boolean strict)
toMerge - the type to merge into this onestrict - should schema primitive types matchCopyright © 2019 The Apache Software Foundation. All rights reserved.