rockserver/src/main/java/it/cavallium/rockserver/core/common/api/ColumnSchema.java

702 lines
24 KiB
Java

/**
* Autogenerated by Thrift Compiler (0.19.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package it.cavallium.rockserver.core.common.api;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
public class ColumnSchema implements org.apache.thrift.TBase<ColumnSchema, ColumnSchema._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnSchema> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnSchema");
private static final org.apache.thrift.protocol.TField FIXED_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("fixedKeys", org.apache.thrift.protocol.TType.LIST, (short)1);
private static final org.apache.thrift.protocol.TField VARIABLE_TAIL_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("variableTailKeys", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField HAS_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("hasValue", org.apache.thrift.protocol.TType.BOOL, (short)3);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ColumnSchemaStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ColumnSchemaTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> fixedKeys; // required
public @org.apache.thrift.annotation.Nullable java.util.List<ColumnHashType> variableTailKeys; // required
public boolean hasValue; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
FIXED_KEYS((short)1, "fixedKeys"),
VARIABLE_TAIL_KEYS((short)2, "variableTailKeys"),
HAS_VALUE((short)3, "hasValue");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // FIXED_KEYS
return FIXED_KEYS;
case 2: // VARIABLE_TAIL_KEYS
return VARIABLE_TAIL_KEYS;
case 3: // HAS_VALUE
return HAS_VALUE;
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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __HASVALUE_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.FIXED_KEYS, new org.apache.thrift.meta_data.FieldMetaData("fixedKeys", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
tmpMap.put(_Fields.VARIABLE_TAIL_KEYS, new org.apache.thrift.meta_data.FieldMetaData("variableTailKeys", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ColumnHashType.class))));
tmpMap.put(_Fields.HAS_VALUE, new org.apache.thrift.meta_data.FieldMetaData("hasValue", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnSchema.class, metaDataMap);
}
public ColumnSchema() {
}
public ColumnSchema(
java.util.List<java.lang.Integer> fixedKeys,
java.util.List<ColumnHashType> variableTailKeys,
boolean hasValue)
{
this();
this.fixedKeys = fixedKeys;
this.variableTailKeys = variableTailKeys;
this.hasValue = hasValue;
setHasValueIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ColumnSchema(ColumnSchema other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetFixedKeys()) {
java.util.List<java.lang.Integer> __this__fixedKeys = new java.util.ArrayList<java.lang.Integer>(other.fixedKeys);
this.fixedKeys = __this__fixedKeys;
}
if (other.isSetVariableTailKeys()) {
java.util.List<ColumnHashType> __this__variableTailKeys = new java.util.ArrayList<ColumnHashType>(other.variableTailKeys.size());
for (ColumnHashType other_element : other.variableTailKeys) {
__this__variableTailKeys.add(other_element);
}
this.variableTailKeys = __this__variableTailKeys;
}
this.hasValue = other.hasValue;
}
@Override
public ColumnSchema deepCopy() {
return new ColumnSchema(this);
}
@Override
public void clear() {
this.fixedKeys = null;
this.variableTailKeys = null;
setHasValueIsSet(false);
this.hasValue = false;
}
public int getFixedKeysSize() {
return (this.fixedKeys == null) ? 0 : this.fixedKeys.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.lang.Integer> getFixedKeysIterator() {
return (this.fixedKeys == null) ? null : this.fixedKeys.iterator();
}
public void addToFixedKeys(int elem) {
if (this.fixedKeys == null) {
this.fixedKeys = new java.util.ArrayList<java.lang.Integer>();
}
this.fixedKeys.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List<java.lang.Integer> getFixedKeys() {
return this.fixedKeys;
}
public ColumnSchema setFixedKeys(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> fixedKeys) {
this.fixedKeys = fixedKeys;
return this;
}
public void unsetFixedKeys() {
this.fixedKeys = null;
}
/** Returns true if field fixedKeys is set (has been assigned a value) and false otherwise */
public boolean isSetFixedKeys() {
return this.fixedKeys != null;
}
public void setFixedKeysIsSet(boolean value) {
if (!value) {
this.fixedKeys = null;
}
}
public int getVariableTailKeysSize() {
return (this.variableTailKeys == null) ? 0 : this.variableTailKeys.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<ColumnHashType> getVariableTailKeysIterator() {
return (this.variableTailKeys == null) ? null : this.variableTailKeys.iterator();
}
public void addToVariableTailKeys(ColumnHashType elem) {
if (this.variableTailKeys == null) {
this.variableTailKeys = new java.util.ArrayList<ColumnHashType>();
}
this.variableTailKeys.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List<ColumnHashType> getVariableTailKeys() {
return this.variableTailKeys;
}
public ColumnSchema setVariableTailKeys(@org.apache.thrift.annotation.Nullable java.util.List<ColumnHashType> variableTailKeys) {
this.variableTailKeys = variableTailKeys;
return this;
}
public void unsetVariableTailKeys() {
this.variableTailKeys = null;
}
/** Returns true if field variableTailKeys is set (has been assigned a value) and false otherwise */
public boolean isSetVariableTailKeys() {
return this.variableTailKeys != null;
}
public void setVariableTailKeysIsSet(boolean value) {
if (!value) {
this.variableTailKeys = null;
}
}
public boolean isHasValue() {
return this.hasValue;
}
public ColumnSchema setHasValue(boolean hasValue) {
this.hasValue = hasValue;
setHasValueIsSet(true);
return this;
}
public void unsetHasValue() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASVALUE_ISSET_ID);
}
/** Returns true if field hasValue is set (has been assigned a value) and false otherwise */
public boolean isSetHasValue() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASVALUE_ISSET_ID);
}
public void setHasValueIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASVALUE_ISSET_ID, value);
}
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case FIXED_KEYS:
if (value == null) {
unsetFixedKeys();
} else {
setFixedKeys((java.util.List<java.lang.Integer>)value);
}
break;
case VARIABLE_TAIL_KEYS:
if (value == null) {
unsetVariableTailKeys();
} else {
setVariableTailKeys((java.util.List<ColumnHashType>)value);
}
break;
case HAS_VALUE:
if (value == null) {
unsetHasValue();
} else {
setHasValue((java.lang.Boolean)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case FIXED_KEYS:
return getFixedKeys();
case VARIABLE_TAIL_KEYS:
return getVariableTailKeys();
case HAS_VALUE:
return isHasValue();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case FIXED_KEYS:
return isSetFixedKeys();
case VARIABLE_TAIL_KEYS:
return isSetVariableTailKeys();
case HAS_VALUE:
return isSetHasValue();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof ColumnSchema)
return this.equals((ColumnSchema)that);
return false;
}
public boolean equals(ColumnSchema that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_fixedKeys = true && this.isSetFixedKeys();
boolean that_present_fixedKeys = true && that.isSetFixedKeys();
if (this_present_fixedKeys || that_present_fixedKeys) {
if (!(this_present_fixedKeys && that_present_fixedKeys))
return false;
if (!this.fixedKeys.equals(that.fixedKeys))
return false;
}
boolean this_present_variableTailKeys = true && this.isSetVariableTailKeys();
boolean that_present_variableTailKeys = true && that.isSetVariableTailKeys();
if (this_present_variableTailKeys || that_present_variableTailKeys) {
if (!(this_present_variableTailKeys && that_present_variableTailKeys))
return false;
if (!this.variableTailKeys.equals(that.variableTailKeys))
return false;
}
boolean this_present_hasValue = true;
boolean that_present_hasValue = true;
if (this_present_hasValue || that_present_hasValue) {
if (!(this_present_hasValue && that_present_hasValue))
return false;
if (this.hasValue != that.hasValue)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetFixedKeys()) ? 131071 : 524287);
if (isSetFixedKeys())
hashCode = hashCode * 8191 + fixedKeys.hashCode();
hashCode = hashCode * 8191 + ((isSetVariableTailKeys()) ? 131071 : 524287);
if (isSetVariableTailKeys())
hashCode = hashCode * 8191 + variableTailKeys.hashCode();
hashCode = hashCode * 8191 + ((hasValue) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(ColumnSchema other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetFixedKeys(), other.isSetFixedKeys());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFixedKeys()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fixedKeys, other.fixedKeys);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetVariableTailKeys(), other.isSetVariableTailKeys());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetVariableTailKeys()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.variableTailKeys, other.variableTailKeys);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetHasValue(), other.isSetHasValue());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetHasValue()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasValue, other.hasValue);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("ColumnSchema(");
boolean first = true;
sb.append("fixedKeys:");
if (this.fixedKeys == null) {
sb.append("null");
} else {
sb.append(this.fixedKeys);
}
first = false;
if (!first) sb.append(", ");
sb.append("variableTailKeys:");
if (this.variableTailKeys == null) {
sb.append("null");
} else {
sb.append(this.variableTailKeys);
}
first = false;
if (!first) sb.append(", ");
sb.append("hasValue:");
sb.append(this.hasValue);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class ColumnSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public ColumnSchemaStandardScheme getScheme() {
return new ColumnSchemaStandardScheme();
}
}
private static class ColumnSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme<ColumnSchema> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnSchema struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // FIXED_KEYS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
struct.fixedKeys = new java.util.ArrayList<java.lang.Integer>(_list0.size);
int _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
_elem1 = iprot.readI32();
struct.fixedKeys.add(_elem1);
}
iprot.readListEnd();
}
struct.setFixedKeysIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // VARIABLE_TAIL_KEYS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
struct.variableTailKeys = new java.util.ArrayList<ColumnHashType>(_list3.size);
@org.apache.thrift.annotation.Nullable ColumnHashType _elem4;
for (int _i5 = 0; _i5 < _list3.size; ++_i5)
{
_elem4 = it.cavallium.rockserver.core.common.api.ColumnHashType.findByValue(iprot.readI32());
if (_elem4 != null)
{
struct.variableTailKeys.add(_elem4);
}
}
iprot.readListEnd();
}
struct.setVariableTailKeysIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // HAS_VALUE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.hasValue = iprot.readBool();
struct.setHasValueIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnSchema struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.fixedKeys != null) {
oprot.writeFieldBegin(FIXED_KEYS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.fixedKeys.size()));
for (int _iter6 : struct.fixedKeys)
{
oprot.writeI32(_iter6);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.variableTailKeys != null) {
oprot.writeFieldBegin(VARIABLE_TAIL_KEYS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.variableTailKeys.size()));
for (ColumnHashType _iter7 : struct.variableTailKeys)
{
oprot.writeI32(_iter7.getValue());
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(HAS_VALUE_FIELD_DESC);
oprot.writeBool(struct.hasValue);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ColumnSchemaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public ColumnSchemaTupleScheme getScheme() {
return new ColumnSchemaTupleScheme();
}
}
private static class ColumnSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme<ColumnSchema> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ColumnSchema struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetFixedKeys()) {
optionals.set(0);
}
if (struct.isSetVariableTailKeys()) {
optionals.set(1);
}
if (struct.isSetHasValue()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetFixedKeys()) {
{
oprot.writeI32(struct.fixedKeys.size());
for (int _iter8 : struct.fixedKeys)
{
oprot.writeI32(_iter8);
}
}
}
if (struct.isSetVariableTailKeys()) {
{
oprot.writeI32(struct.variableTailKeys.size());
for (ColumnHashType _iter9 : struct.variableTailKeys)
{
oprot.writeI32(_iter9.getValue());
}
}
}
if (struct.isSetHasValue()) {
oprot.writeBool(struct.hasValue);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ColumnSchema struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list10 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
struct.fixedKeys = new java.util.ArrayList<java.lang.Integer>(_list10.size);
int _elem11;
for (int _i12 = 0; _i12 < _list10.size; ++_i12)
{
_elem11 = iprot.readI32();
struct.fixedKeys.add(_elem11);
}
}
struct.setFixedKeysIsSet(true);
}
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TList _list13 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
struct.variableTailKeys = new java.util.ArrayList<ColumnHashType>(_list13.size);
@org.apache.thrift.annotation.Nullable ColumnHashType _elem14;
for (int _i15 = 0; _i15 < _list13.size; ++_i15)
{
_elem14 = it.cavallium.rockserver.core.common.api.ColumnHashType.findByValue(iprot.readI32());
if (_elem14 != null)
{
struct.variableTailKeys.add(_elem14);
}
}
}
struct.setVariableTailKeysIsSet(true);
}
if (incoming.get(2)) {
struct.hasValue = iprot.readBool();
struct.setHasValueIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}