Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.parquet.format;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import com.facebook.presto.hive.$internal.org.slf4j.Logger;
import com.facebook.presto.hive.$internal.org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
* Represents a element inside a schema definition.
* - if it is a group (inner node) then type is undefined and num_children is defined
* - if it is a primitive type (leaf) then type is defined and num_children is undefined
* the nodes are listed in depth first traversal order.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-10-17")
public class SchemaElement implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SchemaElement");
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField TYPE_LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("type_length", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField REPETITION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("repetition_type", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField NUM_CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("num_children", org.apache.thrift.protocol.TType.I32, (short)5);
private static final org.apache.thrift.protocol.TField CONVERTED_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("converted_type", org.apache.thrift.protocol.TType.I32, (short)6);
private static final org.apache.thrift.protocol.TField SCALE_FIELD_DESC = new org.apache.thrift.protocol.TField("scale", org.apache.thrift.protocol.TType.I32, (short)7);
private static final org.apache.thrift.protocol.TField PRECISION_FIELD_DESC = new org.apache.thrift.protocol.TField("precision", org.apache.thrift.protocol.TType.I32, (short)8);
private static final org.apache.thrift.protocol.TField FIELD_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("field_id", org.apache.thrift.protocol.TType.I32, (short)9);
private static final org.apache.thrift.protocol.TField LOGICAL_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("logicalType", org.apache.thrift.protocol.TType.STRUCT, (short)10);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new SchemaElementStandardSchemeFactory());
schemes.put(TupleScheme.class, new SchemaElementTupleSchemeFactory());
}
/**
* Data type for this field. Not set if the current element is a non-leaf node
*
* @see Type
*/
public Type type; // optional
/**
* If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the vales.
* Otherwise, if specified, this is the maximum bit length to store any of the values.
* (e.g. a low cardinality INT col could have this set to 3). Note that this is
* in the schema, and therefore fixed for the entire file.
*/
public int type_length; // optional
/**
* repetition of the field. The root of the schema does not have a repetition_type.
* All other nodes must have one
*
* @see FieldRepetitionType
*/
public FieldRepetitionType repetition_type; // optional
/**
* Name of the field in the schema
*/
public String name; // required
/**
* Nested fields. Since thrift does not support nested fields,
* the nesting is flattened to a single list by a depth-first traversal.
* The children count is used to construct the nested relationship.
* This field is not set when the element is a primitive type
*/
public int num_children; // optional
/**
* When the schema is the result of a conversion from another model
* Used to record the original type to help with cross conversion.
*
* @see ConvertedType
*/
public ConvertedType converted_type; // optional
/**
* Used when this column contains decimal data.
* See the DECIMAL converted type for more details.
*/
public int scale; // optional
public int precision; // optional
/**
* When the original schema supports field ids, this will save the
* original field id in the parquet schema
*/
public int field_id; // optional
/**
* The logical type of this SchemaElement; only valid for primitives.
*
* LogicalType replaces ConvertedType, but ConvertedType is still required
* for some logical types to ensure forward-compatibility in format v1.
*/
public LogicalType logicalType; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* Data type for this field. Not set if the current element is a non-leaf node
*
* @see Type
*/
TYPE((short)1, "type"),
/**
* If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the vales.
* Otherwise, if specified, this is the maximum bit length to store any of the values.
* (e.g. a low cardinality INT col could have this set to 3). Note that this is
* in the schema, and therefore fixed for the entire file.
*/
TYPE_LENGTH((short)2, "type_length"),
/**
* repetition of the field. The root of the schema does not have a repetition_type.
* All other nodes must have one
*
* @see FieldRepetitionType
*/
REPETITION_TYPE((short)3, "repetition_type"),
/**
* Name of the field in the schema
*/
NAME((short)4, "name"),
/**
* Nested fields. Since thrift does not support nested fields,
* the nesting is flattened to a single list by a depth-first traversal.
* The children count is used to construct the nested relationship.
* This field is not set when the element is a primitive type
*/
NUM_CHILDREN((short)5, "num_children"),
/**
* When the schema is the result of a conversion from another model
* Used to record the original type to help with cross conversion.
*
* @see ConvertedType
*/
CONVERTED_TYPE((short)6, "converted_type"),
/**
* Used when this column contains decimal data.
* See the DECIMAL converted type for more details.
*/
SCALE((short)7, "scale"),
PRECISION((short)8, "precision"),
/**
* When the original schema supports field ids, this will save the
* original field id in the parquet schema
*/
FIELD_ID((short)9, "field_id"),
/**
* The logical type of this SchemaElement; only valid for primitives.
*
* LogicalType replaces ConvertedType, but ConvertedType is still required
* for some logical types to ensure forward-compatibility in format v1.
*/
LOGICAL_TYPE((short)10, "logicalType");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TYPE
return TYPE;
case 2: // TYPE_LENGTH
return TYPE_LENGTH;
case 3: // REPETITION_TYPE
return REPETITION_TYPE;
case 4: // NAME
return NAME;
case 5: // NUM_CHILDREN
return NUM_CHILDREN;
case 6: // CONVERTED_TYPE
return CONVERTED_TYPE;
case 7: // SCALE
return SCALE;
case 8: // PRECISION
return PRECISION;
case 9: // FIELD_ID
return FIELD_ID;
case 10: // LOGICAL_TYPE
return LOGICAL_TYPE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __TYPE_LENGTH_ISSET_ID = 0;
private static final int __NUM_CHILDREN_ISSET_ID = 1;
private static final int __SCALE_ISSET_ID = 2;
private static final int __PRECISION_ISSET_ID = 3;
private static final int __FIELD_ID_ISSET_ID = 4;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.TYPE,_Fields.TYPE_LENGTH,_Fields.REPETITION_TYPE,_Fields.NUM_CHILDREN,_Fields.CONVERTED_TYPE,_Fields.SCALE,_Fields.PRECISION,_Fields.FIELD_ID,_Fields.LOGICAL_TYPE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Type.class)));
tmpMap.put(_Fields.TYPE_LENGTH, new org.apache.thrift.meta_data.FieldMetaData("type_length", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.REPETITION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("repetition_type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, FieldRepetitionType.class)));
tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NUM_CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("num_children", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.CONVERTED_TYPE, new org.apache.thrift.meta_data.FieldMetaData("converted_type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConvertedType.class)));
tmpMap.put(_Fields.SCALE, new org.apache.thrift.meta_data.FieldMetaData("scale", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.PRECISION, new org.apache.thrift.meta_data.FieldMetaData("precision", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.FIELD_ID, new org.apache.thrift.meta_data.FieldMetaData("field_id", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.LOGICAL_TYPE, new org.apache.thrift.meta_data.FieldMetaData("logicalType", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LogicalType.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SchemaElement.class, metaDataMap);
}
public SchemaElement() {
}
public SchemaElement(
String name)
{
this();
this.name = name;
}
/**
* Performs a deep copy on other.
*/
public SchemaElement(SchemaElement other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetType()) {
this.type = other.type;
}
this.type_length = other.type_length;
if (other.isSetRepetition_type()) {
this.repetition_type = other.repetition_type;
}
if (other.isSetName()) {
this.name = other.name;
}
this.num_children = other.num_children;
if (other.isSetConverted_type()) {
this.converted_type = other.converted_type;
}
this.scale = other.scale;
this.precision = other.precision;
this.field_id = other.field_id;
if (other.isSetLogicalType()) {
this.logicalType = new LogicalType(other.logicalType);
}
}
public SchemaElement deepCopy() {
return new SchemaElement(this);
}
@Override
public void clear() {
this.type = null;
setType_lengthIsSet(false);
this.type_length = 0;
this.repetition_type = null;
this.name = null;
setNum_childrenIsSet(false);
this.num_children = 0;
this.converted_type = null;
setScaleIsSet(false);
this.scale = 0;
setPrecisionIsSet(false);
this.precision = 0;
setField_idIsSet(false);
this.field_id = 0;
this.logicalType = null;
}
/**
* Data type for this field. Not set if the current element is a non-leaf node
*
* @see Type
*/
public Type getType() {
return this.type;
}
/**
* Data type for this field. Not set if the current element is a non-leaf node
*
* @see Type
*/
public SchemaElement setType(Type type) {
this.type = type;
return this;
}
public void unsetType() {
this.type = null;
}
/** Returns true if field type is set (has been assigned a value) and false otherwise */
public boolean isSetType() {
return this.type != null;
}
public void setTypeIsSet(boolean value) {
if (!value) {
this.type = null;
}
}
/**
* If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the vales.
* Otherwise, if specified, this is the maximum bit length to store any of the values.
* (e.g. a low cardinality INT col could have this set to 3). Note that this is
* in the schema, and therefore fixed for the entire file.
*/
public int getType_length() {
return this.type_length;
}
/**
* If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the vales.
* Otherwise, if specified, this is the maximum bit length to store any of the values.
* (e.g. a low cardinality INT col could have this set to 3). Note that this is
* in the schema, and therefore fixed for the entire file.
*/
public SchemaElement setType_length(int type_length) {
this.type_length = type_length;
setType_lengthIsSet(true);
return this;
}
public void unsetType_length() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TYPE_LENGTH_ISSET_ID);
}
/** Returns true if field type_length is set (has been assigned a value) and false otherwise */
public boolean isSetType_length() {
return EncodingUtils.testBit(__isset_bitfield, __TYPE_LENGTH_ISSET_ID);
}
public void setType_lengthIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TYPE_LENGTH_ISSET_ID, value);
}
/**
* repetition of the field. The root of the schema does not have a repetition_type.
* All other nodes must have one
*
* @see FieldRepetitionType
*/
public FieldRepetitionType getRepetition_type() {
return this.repetition_type;
}
/**
* repetition of the field. The root of the schema does not have a repetition_type.
* All other nodes must have one
*
* @see FieldRepetitionType
*/
public SchemaElement setRepetition_type(FieldRepetitionType repetition_type) {
this.repetition_type = repetition_type;
return this;
}
public void unsetRepetition_type() {
this.repetition_type = null;
}
/** Returns true if field repetition_type is set (has been assigned a value) and false otherwise */
public boolean isSetRepetition_type() {
return this.repetition_type != null;
}
public void setRepetition_typeIsSet(boolean value) {
if (!value) {
this.repetition_type = null;
}
}
/**
* Name of the field in the schema
*/
public String getName() {
return this.name;
}
/**
* Name of the field in the schema
*/
public SchemaElement setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
/**
* Nested fields. Since thrift does not support nested fields,
* the nesting is flattened to a single list by a depth-first traversal.
* The children count is used to construct the nested relationship.
* This field is not set when the element is a primitive type
*/
public int getNum_children() {
return this.num_children;
}
/**
* Nested fields. Since thrift does not support nested fields,
* the nesting is flattened to a single list by a depth-first traversal.
* The children count is used to construct the nested relationship.
* This field is not set when the element is a primitive type
*/
public SchemaElement setNum_children(int num_children) {
this.num_children = num_children;
setNum_childrenIsSet(true);
return this;
}
public void unsetNum_children() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_CHILDREN_ISSET_ID);
}
/** Returns true if field num_children is set (has been assigned a value) and false otherwise */
public boolean isSetNum_children() {
return EncodingUtils.testBit(__isset_bitfield, __NUM_CHILDREN_ISSET_ID);
}
public void setNum_childrenIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_CHILDREN_ISSET_ID, value);
}
/**
* When the schema is the result of a conversion from another model
* Used to record the original type to help with cross conversion.
*
* @see ConvertedType
*/
public ConvertedType getConverted_type() {
return this.converted_type;
}
/**
* When the schema is the result of a conversion from another model
* Used to record the original type to help with cross conversion.
*
* @see ConvertedType
*/
public SchemaElement setConverted_type(ConvertedType converted_type) {
this.converted_type = converted_type;
return this;
}
public void unsetConverted_type() {
this.converted_type = null;
}
/** Returns true if field converted_type is set (has been assigned a value) and false otherwise */
public boolean isSetConverted_type() {
return this.converted_type != null;
}
public void setConverted_typeIsSet(boolean value) {
if (!value) {
this.converted_type = null;
}
}
/**
* Used when this column contains decimal data.
* See the DECIMAL converted type for more details.
*/
public int getScale() {
return this.scale;
}
/**
* Used when this column contains decimal data.
* See the DECIMAL converted type for more details.
*/
public SchemaElement setScale(int scale) {
this.scale = scale;
setScaleIsSet(true);
return this;
}
public void unsetScale() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCALE_ISSET_ID);
}
/** Returns true if field scale is set (has been assigned a value) and false otherwise */
public boolean isSetScale() {
return EncodingUtils.testBit(__isset_bitfield, __SCALE_ISSET_ID);
}
public void setScaleIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCALE_ISSET_ID, value);
}
public int getPrecision() {
return this.precision;
}
public SchemaElement setPrecision(int precision) {
this.precision = precision;
setPrecisionIsSet(true);
return this;
}
public void unsetPrecision() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PRECISION_ISSET_ID);
}
/** Returns true if field precision is set (has been assigned a value) and false otherwise */
public boolean isSetPrecision() {
return EncodingUtils.testBit(__isset_bitfield, __PRECISION_ISSET_ID);
}
public void setPrecisionIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PRECISION_ISSET_ID, value);
}
/**
* When the original schema supports field ids, this will save the
* original field id in the parquet schema
*/
public int getField_id() {
return this.field_id;
}
/**
* When the original schema supports field ids, this will save the
* original field id in the parquet schema
*/
public SchemaElement setField_id(int field_id) {
this.field_id = field_id;
setField_idIsSet(true);
return this;
}
public void unsetField_id() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FIELD_ID_ISSET_ID);
}
/** Returns true if field field_id is set (has been assigned a value) and false otherwise */
public boolean isSetField_id() {
return EncodingUtils.testBit(__isset_bitfield, __FIELD_ID_ISSET_ID);
}
public void setField_idIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FIELD_ID_ISSET_ID, value);
}
/**
* The logical type of this SchemaElement; only valid for primitives.
*
* LogicalType replaces ConvertedType, but ConvertedType is still required
* for some logical types to ensure forward-compatibility in format v1.
*/
public LogicalType getLogicalType() {
return this.logicalType;
}
/**
* The logical type of this SchemaElement; only valid for primitives.
*
* LogicalType replaces ConvertedType, but ConvertedType is still required
* for some logical types to ensure forward-compatibility in format v1.
*/
public SchemaElement setLogicalType(LogicalType logicalType) {
this.logicalType = logicalType;
return this;
}
public void unsetLogicalType() {
this.logicalType = null;
}
/** Returns true if field logicalType is set (has been assigned a value) and false otherwise */
public boolean isSetLogicalType() {
return this.logicalType != null;
}
public void setLogicalTypeIsSet(boolean value) {
if (!value) {
this.logicalType = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TYPE:
if (value == null) {
unsetType();
} else {
setType((Type)value);
}
break;
case TYPE_LENGTH:
if (value == null) {
unsetType_length();
} else {
setType_length((Integer)value);
}
break;
case REPETITION_TYPE:
if (value == null) {
unsetRepetition_type();
} else {
setRepetition_type((FieldRepetitionType)value);
}
break;
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case NUM_CHILDREN:
if (value == null) {
unsetNum_children();
} else {
setNum_children((Integer)value);
}
break;
case CONVERTED_TYPE:
if (value == null) {
unsetConverted_type();
} else {
setConverted_type((ConvertedType)value);
}
break;
case SCALE:
if (value == null) {
unsetScale();
} else {
setScale((Integer)value);
}
break;
case PRECISION:
if (value == null) {
unsetPrecision();
} else {
setPrecision((Integer)value);
}
break;
case FIELD_ID:
if (value == null) {
unsetField_id();
} else {
setField_id((Integer)value);
}
break;
case LOGICAL_TYPE:
if (value == null) {
unsetLogicalType();
} else {
setLogicalType((LogicalType)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TYPE:
return getType();
case TYPE_LENGTH:
return getType_length();
case REPETITION_TYPE:
return getRepetition_type();
case NAME:
return getName();
case NUM_CHILDREN:
return getNum_children();
case CONVERTED_TYPE:
return getConverted_type();
case SCALE:
return getScale();
case PRECISION:
return getPrecision();
case FIELD_ID:
return getField_id();
case LOGICAL_TYPE:
return getLogicalType();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case TYPE:
return isSetType();
case TYPE_LENGTH:
return isSetType_length();
case REPETITION_TYPE:
return isSetRepetition_type();
case NAME:
return isSetName();
case NUM_CHILDREN:
return isSetNum_children();
case CONVERTED_TYPE:
return isSetConverted_type();
case SCALE:
return isSetScale();
case PRECISION:
return isSetPrecision();
case FIELD_ID:
return isSetField_id();
case LOGICAL_TYPE:
return isSetLogicalType();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof SchemaElement)
return this.equals((SchemaElement)that);
return false;
}
public boolean equals(SchemaElement that) {
if (that == null)
return false;
boolean this_present_type = true && this.isSetType();
boolean that_present_type = true && that.isSetType();
if (this_present_type || that_present_type) {
if (!(this_present_type && that_present_type))
return false;
if (!this.type.equals(that.type))
return false;
}
boolean this_present_type_length = true && this.isSetType_length();
boolean that_present_type_length = true && that.isSetType_length();
if (this_present_type_length || that_present_type_length) {
if (!(this_present_type_length && that_present_type_length))
return false;
if (this.type_length != that.type_length)
return false;
}
boolean this_present_repetition_type = true && this.isSetRepetition_type();
boolean that_present_repetition_type = true && that.isSetRepetition_type();
if (this_present_repetition_type || that_present_repetition_type) {
if (!(this_present_repetition_type && that_present_repetition_type))
return false;
if (!this.repetition_type.equals(that.repetition_type))
return false;
}
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_num_children = true && this.isSetNum_children();
boolean that_present_num_children = true && that.isSetNum_children();
if (this_present_num_children || that_present_num_children) {
if (!(this_present_num_children && that_present_num_children))
return false;
if (this.num_children != that.num_children)
return false;
}
boolean this_present_converted_type = true && this.isSetConverted_type();
boolean that_present_converted_type = true && that.isSetConverted_type();
if (this_present_converted_type || that_present_converted_type) {
if (!(this_present_converted_type && that_present_converted_type))
return false;
if (!this.converted_type.equals(that.converted_type))
return false;
}
boolean this_present_scale = true && this.isSetScale();
boolean that_present_scale = true && that.isSetScale();
if (this_present_scale || that_present_scale) {
if (!(this_present_scale && that_present_scale))
return false;
if (this.scale != that.scale)
return false;
}
boolean this_present_precision = true && this.isSetPrecision();
boolean that_present_precision = true && that.isSetPrecision();
if (this_present_precision || that_present_precision) {
if (!(this_present_precision && that_present_precision))
return false;
if (this.precision != that.precision)
return false;
}
boolean this_present_field_id = true && this.isSetField_id();
boolean that_present_field_id = true && that.isSetField_id();
if (this_present_field_id || that_present_field_id) {
if (!(this_present_field_id && that_present_field_id))
return false;
if (this.field_id != that.field_id)
return false;
}
boolean this_present_logicalType = true && this.isSetLogicalType();
boolean that_present_logicalType = true && that.isSetLogicalType();
if (this_present_logicalType || that_present_logicalType) {
if (!(this_present_logicalType && that_present_logicalType))
return false;
if (!this.logicalType.equals(that.logicalType))
return false;
}
return true;
}
@Override
public int hashCode() {
List