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() |
void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
asGroupType, asPrimitiveType, equals, getName, getOriginalType, getRepetition, hashCode, isRepetition, toStringpublic 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)
required - name - fields - GroupType#GroupType(Repetition, String, List)public GroupType(Type.Repetition repetition, String name, OriginalType originalType, Type... fields)
public GroupType(Type.Repetition repetition, String name, OriginalType originalType, List<Type> fields)
public 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 Typepublic Type getType(String fieldName)
fieldName - public Type getType(int index)
index - public void writeToStringBuilder(StringBuilder sb, String indent)
writeToStringBuilder in class Typesb - the StringBuilder to write itself topublic void accept(TypeVisitor visitor)
protected int typeHashCode()
typeHashCode in class Typeprotected boolean typeEquals(Type other)
typeEquals in class Typeprotected int getMaxRepetitionLevel(String[] path, int depth)
getMaxRepetitionLevel in class Typeprotected int getMaxDefinitionLevel(String[] path, int depth)
getMaxDefinitionLevel in class Typeprotected boolean containsPath(String[] path, int depth)
containsPath in class Typeprotected <T> List<T> convertChildren(List<GroupType> path, TypeConverter<T> converter)
Copyright © 2013. All Rights Reserved.