public class GroupType extends Type
Type.Repetition
Constructor and Description |
---|
GroupType(Type.Repetition repetition,
String name,
List<Type> fields) |
GroupType(Type.Repetition repetition,
String name,
OriginalType originalType,
List<Type> fields) |
GroupType(Type.Repetition repetition,
String name,
OriginalType originalType,
Type... fields) |
GroupType(Type.Repetition repetition,
String name,
Type... fields) |
Modifier and Type | Method and Description |
---|---|
void |
accept(TypeVisitor visitor)
Visits this type with the given visitor
|
boolean |
containsField(String name) |
protected boolean |
containsPath(String[] path,
int depth) |
protected <T> List<T> |
convertChildren(List<GroupType> path,
TypeConverter<T> converter) |
int |
getFieldCount() |
int |
getFieldIndex(String name) |
String |
getFieldName(int index)
returns the name of the corresponding field
|
List<Type> |
getFields() |
protected int |
getMaxDefinitionLevel(String[] path,
int depth) |
protected int |
getMaxRepetitionLevel(String[] path,
int depth) |
protected List<String[]> |
getPaths(int depth) |
Type |
getType(int index) |
Type |
getType(String fieldName) |
protected Type |
getType(String[] path,
int depth) |
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 GroupType(Type.Repetition repetition, String name, List<Type> fields)
repetition
- OPTIONAL, REPEATED, REQUIREDname
- the name of the fieldfields
- the contained fieldspublic GroupType(Type.Repetition repetition, String name, Type... fields)
repetition
- OPTIONAL, REPEATED, REQUIREDname
- the name of the fieldfields
- the contained fieldspublic GroupType(Type.Repetition repetition, String name, OriginalType originalType, Type... fields)
repetition
- OPTIONAL, REPEATED, REQUIREDname
- the name of the fieldoriginalType
- (optional) the original type to help with cross schema convertion (LIST, MAP, ...)fields
- the contained fieldspublic GroupType(Type.Repetition repetition, String name, OriginalType originalType, List<Type> fields)
repetition
- OPTIONAL, REPEATED, REQUIREDname
- the name of the fieldoriginalType
- (optional) the original type to help with cross schema convertion (LIST, MAP, ...)fields
- the contained fieldspublic String getFieldName(int index)
index
- the index of the desired field in this typepublic boolean containsField(String name)
name
- the requested namepublic int getFieldIndex(String name)
name
- public int getFieldCount()
public boolean isPrimitive()
isPrimitive
in class Type
public Type getType(String fieldName)
fieldName
- public Type getType(int index)
index
- public void writeToStringBuilder(StringBuilder sb, String indent)
writeToStringBuilder
in class Type
sb
- the StringBuilder to write itself topublic void accept(TypeVisitor visitor)
protected int typeHashCode()
typeHashCode
in class Type
protected boolean typeEquals(Type other)
typeEquals
in class Type
protected int getMaxRepetitionLevel(String[] path, int depth)
getMaxRepetitionLevel
in class Type
protected int getMaxDefinitionLevel(String[] path, int depth)
getMaxDefinitionLevel
in class Type
protected boolean containsPath(String[] path, int depth)
containsPath
in class Type
protected <T> List<T> convertChildren(List<GroupType> path, TypeConverter<T> converter)
Copyright © 2015. All rights reserved.