Add thrift files

This commit is contained in:
Andrea Cavalli 2024-10-06 14:27:01 +02:00
parent 11b1d800dc
commit c97b0b8918
7 changed files with 26072 additions and 0 deletions

View File

@ -0,0 +1,46 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package it.cavallium.rockserver.core.common.api;
public enum ColumnHashType implements org.apache.thrift.TEnum {
XXHASH32(1),
XXHASH8(2),
ALLSAME8(3);
private final int value;
private ColumnHashType(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
@Override
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
@org.apache.thrift.annotation.Nullable
public static ColumnHashType findByValue(int value) {
switch (value) {
case 1:
return XXHASH32;
case 2:
return XXHASH8;
case 3:
return ALLSAME8;
default:
return null;
}
}
}

View File

@ -0,0 +1,701 @@
/**
* Autogenerated by Thrift Compiler (0.20.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();
}
}

View File

@ -0,0 +1,518 @@
/**
* Autogenerated by Thrift Compiler (0.20.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 Delta implements org.apache.thrift.TBase<Delta, Delta._Fields>, java.io.Serializable, Cloneable, Comparable<Delta> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Delta");
private static final org.apache.thrift.protocol.TField PREVIOUS_FIELD_DESC = new org.apache.thrift.protocol.TField("previous", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField CURRENT_FIELD_DESC = new org.apache.thrift.protocol.TField("current", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new DeltaStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new DeltaTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous; // optional
public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer current; // 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 {
PREVIOUS((short)1, "previous"),
CURRENT((short)2, "current");
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: // PREVIOUS
return PREVIOUS;
case 2: // CURRENT
return CURRENT;
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 _Fields optionals[] = {_Fields.PREVIOUS,_Fields.CURRENT};
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.PREVIOUS, new org.apache.thrift.meta_data.FieldMetaData("previous", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.CURRENT, new org.apache.thrift.meta_data.FieldMetaData("current", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Delta.class, metaDataMap);
}
public Delta() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public Delta(Delta other) {
if (other.isSetPrevious()) {
this.previous = org.apache.thrift.TBaseHelper.copyBinary(other.previous);
}
if (other.isSetCurrent()) {
this.current = org.apache.thrift.TBaseHelper.copyBinary(other.current);
}
}
@Override
public Delta deepCopy() {
return new Delta(this);
}
@Override
public void clear() {
this.previous = null;
this.current = null;
}
public byte[] getPrevious() {
setPrevious(org.apache.thrift.TBaseHelper.rightSize(previous));
return previous == null ? null : previous.array();
}
public java.nio.ByteBuffer bufferForPrevious() {
return org.apache.thrift.TBaseHelper.copyBinary(previous);
}
public Delta setPrevious(byte[] previous) {
this.previous = previous == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(previous.clone());
return this;
}
public Delta setPrevious(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous) {
this.previous = org.apache.thrift.TBaseHelper.copyBinary(previous);
return this;
}
public void unsetPrevious() {
this.previous = null;
}
/** Returns true if field previous is set (has been assigned a value) and false otherwise */
public boolean isSetPrevious() {
return this.previous != null;
}
public void setPreviousIsSet(boolean value) {
if (!value) {
this.previous = null;
}
}
public byte[] getCurrent() {
setCurrent(org.apache.thrift.TBaseHelper.rightSize(current));
return current == null ? null : current.array();
}
public java.nio.ByteBuffer bufferForCurrent() {
return org.apache.thrift.TBaseHelper.copyBinary(current);
}
public Delta setCurrent(byte[] current) {
this.current = current == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(current.clone());
return this;
}
public Delta setCurrent(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer current) {
this.current = org.apache.thrift.TBaseHelper.copyBinary(current);
return this;
}
public void unsetCurrent() {
this.current = null;
}
/** Returns true if field current is set (has been assigned a value) and false otherwise */
public boolean isSetCurrent() {
return this.current != null;
}
public void setCurrentIsSet(boolean value) {
if (!value) {
this.current = null;
}
}
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case PREVIOUS:
if (value == null) {
unsetPrevious();
} else {
if (value instanceof byte[]) {
setPrevious((byte[])value);
} else {
setPrevious((java.nio.ByteBuffer)value);
}
}
break;
case CURRENT:
if (value == null) {
unsetCurrent();
} else {
if (value instanceof byte[]) {
setCurrent((byte[])value);
} else {
setCurrent((java.nio.ByteBuffer)value);
}
}
break;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PREVIOUS:
return getPrevious();
case CURRENT:
return getCurrent();
}
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 PREVIOUS:
return isSetPrevious();
case CURRENT:
return isSetCurrent();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof Delta)
return this.equals((Delta)that);
return false;
}
public boolean equals(Delta that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_previous = true && this.isSetPrevious();
boolean that_present_previous = true && that.isSetPrevious();
if (this_present_previous || that_present_previous) {
if (!(this_present_previous && that_present_previous))
return false;
if (!this.previous.equals(that.previous))
return false;
}
boolean this_present_current = true && this.isSetCurrent();
boolean that_present_current = true && that.isSetCurrent();
if (this_present_current || that_present_current) {
if (!(this_present_current && that_present_current))
return false;
if (!this.current.equals(that.current))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetPrevious()) ? 131071 : 524287);
if (isSetPrevious())
hashCode = hashCode * 8191 + previous.hashCode();
hashCode = hashCode * 8191 + ((isSetCurrent()) ? 131071 : 524287);
if (isSetCurrent())
hashCode = hashCode * 8191 + current.hashCode();
return hashCode;
}
@Override
public int compareTo(Delta other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetPrevious(), other.isSetPrevious());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPrevious()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.previous, other.previous);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetCurrent(), other.isSetCurrent());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCurrent()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.current, other.current);
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("Delta(");
boolean first = true;
if (isSetPrevious()) {
sb.append("previous:");
if (this.previous == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.previous, sb);
}
first = false;
}
if (isSetCurrent()) {
if (!first) sb.append(", ");
sb.append("current:");
if (this.current == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.current, sb);
}
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 {
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 DeltaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public DeltaStandardScheme getScheme() {
return new DeltaStandardScheme();
}
}
private static class DeltaStandardScheme extends org.apache.thrift.scheme.StandardScheme<Delta> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Delta 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: // PREVIOUS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.previous = iprot.readBinary();
struct.setPreviousIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // CURRENT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.current = iprot.readBinary();
struct.setCurrentIsSet(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, Delta struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.previous != null) {
if (struct.isSetPrevious()) {
oprot.writeFieldBegin(PREVIOUS_FIELD_DESC);
oprot.writeBinary(struct.previous);
oprot.writeFieldEnd();
}
}
if (struct.current != null) {
if (struct.isSetCurrent()) {
oprot.writeFieldBegin(CURRENT_FIELD_DESC);
oprot.writeBinary(struct.current);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class DeltaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public DeltaTupleScheme getScheme() {
return new DeltaTupleScheme();
}
}
private static class DeltaTupleScheme extends org.apache.thrift.scheme.TupleScheme<Delta> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Delta 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.isSetPrevious()) {
optionals.set(0);
}
if (struct.isSetCurrent()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetPrevious()) {
oprot.writeBinary(struct.previous);
}
if (struct.isSetCurrent()) {
oprot.writeBinary(struct.current);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Delta struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.previous = iprot.readBinary();
struct.setPreviousIsSet(true);
}
if (incoming.get(1)) {
struct.current = iprot.readBinary();
struct.setCurrentIsSet(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();
}
}

View File

@ -0,0 +1,64 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package it.cavallium.rockserver.core.common.api;
public enum Operation implements org.apache.thrift.TEnum {
NOTHING(1),
PREVIOUS(2),
CURRENT(3),
FOR_UPDATE(4),
EXISTS(5),
DELTA(6),
MULTI(7),
CHANGED(8),
PREVIOUS_PRESENCE(9);
private final int value;
private Operation(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
@Override
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
@org.apache.thrift.annotation.Nullable
public static Operation findByValue(int value) {
switch (value) {
case 1:
return NOTHING;
case 2:
return PREVIOUS;
case 3:
return CURRENT;
case 4:
return FOR_UPDATE;
case 5:
return EXISTS;
case 6:
return DELTA;
case 7:
return MULTI;
case 8:
return CHANGED;
case 9:
return PREVIOUS_PRESENCE;
default:
return null;
}
}
}

View File

@ -0,0 +1,398 @@
/**
* Autogenerated by Thrift Compiler (0.20.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 OptionalBinary implements org.apache.thrift.TBase<OptionalBinary, OptionalBinary._Fields>, java.io.Serializable, Cloneable, Comparable<OptionalBinary> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OptionalBinary");
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OptionalBinaryStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OptionalBinaryTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // 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 {
VALUE((short)1, "value");
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: // VALUE
return 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 _Fields optionals[] = {_Fields.VALUE};
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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptionalBinary.class, metaDataMap);
}
public OptionalBinary() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public OptionalBinary(OptionalBinary other) {
if (other.isSetValue()) {
this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value);
}
}
@Override
public OptionalBinary deepCopy() {
return new OptionalBinary(this);
}
@Override
public void clear() {
this.value = null;
}
public byte[] getValue() {
setValue(org.apache.thrift.TBaseHelper.rightSize(value));
return value == null ? null : value.array();
}
public java.nio.ByteBuffer bufferForValue() {
return org.apache.thrift.TBaseHelper.copyBinary(value);
}
public OptionalBinary setValue(byte[] value) {
this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone());
return this;
}
public OptionalBinary setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) {
this.value = org.apache.thrift.TBaseHelper.copyBinary(value);
return this;
}
public void unsetValue() {
this.value = null;
}
/** Returns true if field value is set (has been assigned a value) and false otherwise */
public boolean isSetValue() {
return this.value != null;
}
public void setValueIsSet(boolean value) {
if (!value) {
this.value = null;
}
}
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case VALUE:
if (value == null) {
unsetValue();
} else {
if (value instanceof byte[]) {
setValue((byte[])value);
} else {
setValue((java.nio.ByteBuffer)value);
}
}
break;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case VALUE:
return getValue();
}
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 VALUE:
return isSetValue();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof OptionalBinary)
return this.equals((OptionalBinary)that);
return false;
}
public boolean equals(OptionalBinary that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_value = true && this.isSetValue();
boolean that_present_value = true && that.isSetValue();
if (this_present_value || that_present_value) {
if (!(this_present_value && that_present_value))
return false;
if (!this.value.equals(that.value))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287);
if (isSetValue())
hashCode = hashCode * 8191 + value.hashCode();
return hashCode;
}
@Override
public int compareTo(OptionalBinary other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetValue()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value);
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("OptionalBinary(");
boolean first = true;
if (isSetValue()) {
sb.append("value:");
if (this.value == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.value, sb);
}
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 {
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 OptionalBinaryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public OptionalBinaryStandardScheme getScheme() {
return new OptionalBinaryStandardScheme();
}
}
private static class OptionalBinaryStandardScheme extends org.apache.thrift.scheme.StandardScheme<OptionalBinary> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, OptionalBinary 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: // VALUE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.value = iprot.readBinary();
struct.setValueIsSet(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, OptionalBinary struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.value != null) {
if (struct.isSetValue()) {
oprot.writeFieldBegin(VALUE_FIELD_DESC);
oprot.writeBinary(struct.value);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class OptionalBinaryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public OptionalBinaryTupleScheme getScheme() {
return new OptionalBinaryTupleScheme();
}
}
private static class OptionalBinaryTupleScheme extends org.apache.thrift.scheme.TupleScheme<OptionalBinary> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, OptionalBinary 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.isSetValue()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetValue()) {
oprot.writeBinary(struct.value);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, OptionalBinary struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.value = iprot.readBinary();
struct.setValueIsSet(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();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,501 @@
/**
* Autogenerated by Thrift Compiler (0.20.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 UpdateBegin implements org.apache.thrift.TBase<UpdateBegin, UpdateBegin._Fields>, java.io.Serializable, Cloneable, Comparable<UpdateBegin> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UpdateBegin");
private static final org.apache.thrift.protocol.TField PREVIOUS_FIELD_DESC = new org.apache.thrift.protocol.TField("previous", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("updateId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UpdateBeginStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UpdateBeginTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous; // optional
public long updateId; // 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 {
PREVIOUS((short)1, "previous"),
UPDATE_ID((short)2, "updateId");
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: // PREVIOUS
return PREVIOUS;
case 2: // UPDATE_ID
return UPDATE_ID;
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 __UPDATEID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.PREVIOUS,_Fields.UPDATE_ID};
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.PREVIOUS, new org.apache.thrift.meta_data.FieldMetaData("previous", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("updateId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UpdateBegin.class, metaDataMap);
}
public UpdateBegin() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public UpdateBegin(UpdateBegin other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetPrevious()) {
this.previous = org.apache.thrift.TBaseHelper.copyBinary(other.previous);
}
this.updateId = other.updateId;
}
@Override
public UpdateBegin deepCopy() {
return new UpdateBegin(this);
}
@Override
public void clear() {
this.previous = null;
setUpdateIdIsSet(false);
this.updateId = 0;
}
public byte[] getPrevious() {
setPrevious(org.apache.thrift.TBaseHelper.rightSize(previous));
return previous == null ? null : previous.array();
}
public java.nio.ByteBuffer bufferForPrevious() {
return org.apache.thrift.TBaseHelper.copyBinary(previous);
}
public UpdateBegin setPrevious(byte[] previous) {
this.previous = previous == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(previous.clone());
return this;
}
public UpdateBegin setPrevious(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous) {
this.previous = org.apache.thrift.TBaseHelper.copyBinary(previous);
return this;
}
public void unsetPrevious() {
this.previous = null;
}
/** Returns true if field previous is set (has been assigned a value) and false otherwise */
public boolean isSetPrevious() {
return this.previous != null;
}
public void setPreviousIsSet(boolean value) {
if (!value) {
this.previous = null;
}
}
public long getUpdateId() {
return this.updateId;
}
public UpdateBegin setUpdateId(long updateId) {
this.updateId = updateId;
setUpdateIdIsSet(true);
return this;
}
public void unsetUpdateId() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATEID_ISSET_ID);
}
/** Returns true if field updateId is set (has been assigned a value) and false otherwise */
public boolean isSetUpdateId() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATEID_ISSET_ID);
}
public void setUpdateIdIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATEID_ISSET_ID, value);
}
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case PREVIOUS:
if (value == null) {
unsetPrevious();
} else {
if (value instanceof byte[]) {
setPrevious((byte[])value);
} else {
setPrevious((java.nio.ByteBuffer)value);
}
}
break;
case UPDATE_ID:
if (value == null) {
unsetUpdateId();
} else {
setUpdateId((java.lang.Long)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PREVIOUS:
return getPrevious();
case UPDATE_ID:
return getUpdateId();
}
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 PREVIOUS:
return isSetPrevious();
case UPDATE_ID:
return isSetUpdateId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof UpdateBegin)
return this.equals((UpdateBegin)that);
return false;
}
public boolean equals(UpdateBegin that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_previous = true && this.isSetPrevious();
boolean that_present_previous = true && that.isSetPrevious();
if (this_present_previous || that_present_previous) {
if (!(this_present_previous && that_present_previous))
return false;
if (!this.previous.equals(that.previous))
return false;
}
boolean this_present_updateId = true && this.isSetUpdateId();
boolean that_present_updateId = true && that.isSetUpdateId();
if (this_present_updateId || that_present_updateId) {
if (!(this_present_updateId && that_present_updateId))
return false;
if (this.updateId != that.updateId)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetPrevious()) ? 131071 : 524287);
if (isSetPrevious())
hashCode = hashCode * 8191 + previous.hashCode();
hashCode = hashCode * 8191 + ((isSetUpdateId()) ? 131071 : 524287);
if (isSetUpdateId())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(updateId);
return hashCode;
}
@Override
public int compareTo(UpdateBegin other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetPrevious(), other.isSetPrevious());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPrevious()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.previous, other.previous);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetUpdateId(), other.isSetUpdateId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUpdateId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateId, other.updateId);
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("UpdateBegin(");
boolean first = true;
if (isSetPrevious()) {
sb.append("previous:");
if (this.previous == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.previous, sb);
}
first = false;
}
if (isSetUpdateId()) {
if (!first) sb.append(", ");
sb.append("updateId:");
sb.append(this.updateId);
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 UpdateBeginStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public UpdateBeginStandardScheme getScheme() {
return new UpdateBeginStandardScheme();
}
}
private static class UpdateBeginStandardScheme extends org.apache.thrift.scheme.StandardScheme<UpdateBegin> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, UpdateBegin 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: // PREVIOUS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.previous = iprot.readBinary();
struct.setPreviousIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // UPDATE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.updateId = iprot.readI64();
struct.setUpdateIdIsSet(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, UpdateBegin struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.previous != null) {
if (struct.isSetPrevious()) {
oprot.writeFieldBegin(PREVIOUS_FIELD_DESC);
oprot.writeBinary(struct.previous);
oprot.writeFieldEnd();
}
}
if (struct.isSetUpdateId()) {
oprot.writeFieldBegin(UPDATE_ID_FIELD_DESC);
oprot.writeI64(struct.updateId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class UpdateBeginTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public UpdateBeginTupleScheme getScheme() {
return new UpdateBeginTupleScheme();
}
}
private static class UpdateBeginTupleScheme extends org.apache.thrift.scheme.TupleScheme<UpdateBegin> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, UpdateBegin 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.isSetPrevious()) {
optionals.set(0);
}
if (struct.isSetUpdateId()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetPrevious()) {
oprot.writeBinary(struct.previous);
}
if (struct.isSetUpdateId()) {
oprot.writeI64(struct.updateId);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, UpdateBegin struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.previous = iprot.readBinary();
struct.setPreviousIsSet(true);
}
if (incoming.get(1)) {
struct.updateId = iprot.readI64();
struct.setUpdateIdIsSet(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();
}
}