public class GroupType extends Type
Type.ID, 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)
Deprecated.
|
GroupType(Type.Repetition repetition,
String name,
OriginalType originalType,
Type... fields)
Deprecated.
|
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) |
protected boolean |
equals(Type otherType) |
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) |
int |
hashCode() |
boolean |
isPrimitive() |
protected boolean |
typeEquals(Type other)
Deprecated.
|
protected int |
typeHashCode()
Deprecated.
|
protected Type |
union(Type toMerge) |
protected Type |
union(Type toMerge,
boolean strict) |
GroupType |
withId(int id) |
GroupType |
withNewFields(List<Type> newFields) |
GroupType |
withNewFields(Type... newFields) |
void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
asGroupType, asPrimitiveType, eqOrBothNull, equals, getId, getLogicalTypeAnnotation, getName, getOriginalType, getRepetition, 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)
repetition - OPTIONAL, REPEATED, REQUIREDname - the name of the fieldfields - the contained fields@Deprecated public 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 conversion (LIST, MAP, ...)fields - the contained fields@Deprecated public 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 conversion (LIST, MAP, ...)fields - the contained fieldspublic GroupType withId(int id)
public GroupType withNewFields(List<Type> newFields)
newFields - a list of types to use as fields in a copy of this grouppublic GroupType withNewFields(Type... newFields)
newFields - an array of types to use as fields in a copy of this grouppublic 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 - string name of a fieldpublic int getFieldCount()
public boolean isPrimitive()
isPrimitive in class Typepublic Type getType(String fieldName)
fieldName - string name of a fieldpublic Type getType(int index)
index - integer index of a fieldpublic void writeToStringBuilder(StringBuilder sb, String indent)
writeToStringBuilder in class Typesb - the StringBuilder to write itself toindent - indentation levelpublic void accept(TypeVisitor visitor)
@Deprecated protected int typeHashCode()
typeHashCode in class Type@Deprecated protected 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 © 2023 The Apache Software Foundation. All rights reserved.