502 lines
16 KiB
Java
502 lines
16 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 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();
|
|
}
|
|
}
|
|
|