org.apache.iotdb.service.sync.thrift.ConfirmInfo Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.14.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.iotdb.service.sync.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2022-07-08")
public class ConfirmInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ConfirmInfo");
private static final org.apache.thrift.protocol.TField ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("address", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField UUID_FIELD_DESC = new org.apache.thrift.protocol.TField("uuid", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField PARTITION_INTERVAL_FIELD_DESC = new org.apache.thrift.protocol.TField("partitionInterval", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ConfirmInfoStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ConfirmInfoTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String address; // required
public @org.apache.thrift.annotation.Nullable java.lang.String uuid; // required
public long partitionInterval; // required
public @org.apache.thrift.annotation.Nullable java.lang.String version; // 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 {
ADDRESS((short)1, "address"),
UUID((short)2, "uuid"),
PARTITION_INTERVAL((short)3, "partitionInterval"),
VERSION((short)4, "version");
private static final java.util.Map byName = new java.util.HashMap();
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: // ADDRESS
return ADDRESS;
case 2: // UUID
return UUID;
case 3: // PARTITION_INTERVAL
return PARTITION_INTERVAL;
case 4: // VERSION
return VERSION;
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;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __PARTITIONINTERVAL_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.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.UUID, new org.apache.thrift.meta_data.FieldMetaData("uuid", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PARTITION_INTERVAL, new org.apache.thrift.meta_data.FieldMetaData("partitionInterval", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ConfirmInfo.class, metaDataMap);
}
public ConfirmInfo() {
}
public ConfirmInfo(
java.lang.String address,
java.lang.String uuid,
long partitionInterval,
java.lang.String version)
{
this();
this.address = address;
this.uuid = uuid;
this.partitionInterval = partitionInterval;
setPartitionIntervalIsSet(true);
this.version = version;
}
/**
* Performs a deep copy on other.
*/
public ConfirmInfo(ConfirmInfo other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetAddress()) {
this.address = other.address;
}
if (other.isSetUuid()) {
this.uuid = other.uuid;
}
this.partitionInterval = other.partitionInterval;
if (other.isSetVersion()) {
this.version = other.version;
}
}
public ConfirmInfo deepCopy() {
return new ConfirmInfo(this);
}
@Override
public void clear() {
this.address = null;
this.uuid = null;
setPartitionIntervalIsSet(false);
this.partitionInterval = 0;
this.version = null;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getAddress() {
return this.address;
}
public ConfirmInfo setAddress(@org.apache.thrift.annotation.Nullable java.lang.String address) {
this.address = address;
return this;
}
public void unsetAddress() {
this.address = null;
}
/** Returns true if field address is set (has been assigned a value) and false otherwise */
public boolean isSetAddress() {
return this.address != null;
}
public void setAddressIsSet(boolean value) {
if (!value) {
this.address = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getUuid() {
return this.uuid;
}
public ConfirmInfo setUuid(@org.apache.thrift.annotation.Nullable java.lang.String uuid) {
this.uuid = uuid;
return this;
}
public void unsetUuid() {
this.uuid = null;
}
/** Returns true if field uuid is set (has been assigned a value) and false otherwise */
public boolean isSetUuid() {
return this.uuid != null;
}
public void setUuidIsSet(boolean value) {
if (!value) {
this.uuid = null;
}
}
public long getPartitionInterval() {
return this.partitionInterval;
}
public ConfirmInfo setPartitionInterval(long partitionInterval) {
this.partitionInterval = partitionInterval;
setPartitionIntervalIsSet(true);
return this;
}
public void unsetPartitionInterval() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITIONINTERVAL_ISSET_ID);
}
/** Returns true if field partitionInterval is set (has been assigned a value) and false otherwise */
public boolean isSetPartitionInterval() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITIONINTERVAL_ISSET_ID);
}
public void setPartitionIntervalIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITIONINTERVAL_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getVersion() {
return this.version;
}
public ConfirmInfo setVersion(@org.apache.thrift.annotation.Nullable java.lang.String version) {
this.version = version;
return this;
}
public void unsetVersion() {
this.version = null;
}
/** Returns true if field version is set (has been assigned a value) and false otherwise */
public boolean isSetVersion() {
return this.version != null;
}
public void setVersionIsSet(boolean value) {
if (!value) {
this.version = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ADDRESS:
if (value == null) {
unsetAddress();
} else {
setAddress((java.lang.String)value);
}
break;
case UUID:
if (value == null) {
unsetUuid();
} else {
setUuid((java.lang.String)value);
}
break;
case PARTITION_INTERVAL:
if (value == null) {
unsetPartitionInterval();
} else {
setPartitionInterval((java.lang.Long)value);
}
break;
case VERSION:
if (value == null) {
unsetVersion();
} else {
setVersion((java.lang.String)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ADDRESS:
return getAddress();
case UUID:
return getUuid();
case PARTITION_INTERVAL:
return getPartitionInterval();
case VERSION:
return getVersion();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ADDRESS:
return isSetAddress();
case UUID:
return isSetUuid();
case PARTITION_INTERVAL:
return isSetPartitionInterval();
case VERSION:
return isSetVersion();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof ConfirmInfo)
return this.equals((ConfirmInfo)that);
return false;
}
public boolean equals(ConfirmInfo that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_address = true && this.isSetAddress();
boolean that_present_address = true && that.isSetAddress();
if (this_present_address || that_present_address) {
if (!(this_present_address && that_present_address))
return false;
if (!this.address.equals(that.address))
return false;
}
boolean this_present_uuid = true && this.isSetUuid();
boolean that_present_uuid = true && that.isSetUuid();
if (this_present_uuid || that_present_uuid) {
if (!(this_present_uuid && that_present_uuid))
return false;
if (!this.uuid.equals(that.uuid))
return false;
}
boolean this_present_partitionInterval = true;
boolean that_present_partitionInterval = true;
if (this_present_partitionInterval || that_present_partitionInterval) {
if (!(this_present_partitionInterval && that_present_partitionInterval))
return false;
if (this.partitionInterval != that.partitionInterval)
return false;
}
boolean this_present_version = true && this.isSetVersion();
boolean that_present_version = true && that.isSetVersion();
if (this_present_version || that_present_version) {
if (!(this_present_version && that_present_version))
return false;
if (!this.version.equals(that.version))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetAddress()) ? 131071 : 524287);
if (isSetAddress())
hashCode = hashCode * 8191 + address.hashCode();
hashCode = hashCode * 8191 + ((isSetUuid()) ? 131071 : 524287);
if (isSetUuid())
hashCode = hashCode * 8191 + uuid.hashCode();
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(partitionInterval);
hashCode = hashCode * 8191 + ((isSetVersion()) ? 131071 : 524287);
if (isSetVersion())
hashCode = hashCode * 8191 + version.hashCode();
return hashCode;
}
@Override
public int compareTo(ConfirmInfo other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetAddress(), other.isSetAddress());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAddress()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, other.address);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetUuid(), other.isSetUuid());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUuid()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uuid, other.uuid);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetPartitionInterval(), other.isSetPartitionInterval());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPartitionInterval()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionInterval, other.partitionInterval);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetVersion(), other.isSetVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetVersion()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
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("ConfirmInfo(");
boolean first = true;
sb.append("address:");
if (this.address == null) {
sb.append("null");
} else {
sb.append(this.address);
}
first = false;
if (!first) sb.append(", ");
sb.append("uuid:");
if (this.uuid == null) {
sb.append("null");
} else {
sb.append(this.uuid);
}
first = false;
if (!first) sb.append(", ");
sb.append("partitionInterval:");
sb.append(this.partitionInterval);
first = false;
if (!first) sb.append(", ");
sb.append("version:");
if (this.version == null) {
sb.append("null");
} else {
sb.append(this.version);
}
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 ConfirmInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ConfirmInfoStandardScheme getScheme() {
return new ConfirmInfoStandardScheme();
}
}
private static class ConfirmInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, ConfirmInfo 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: // ADDRESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.address = iprot.readString();
struct.setAddressIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // UUID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.uuid = iprot.readString();
struct.setUuidIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // PARTITION_INTERVAL
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.partitionInterval = iprot.readI64();
struct.setPartitionIntervalIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.version = iprot.readString();
struct.setVersionIsSet(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();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, ConfirmInfo struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.address != null) {
oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
oprot.writeString(struct.address);
oprot.writeFieldEnd();
}
if (struct.uuid != null) {
oprot.writeFieldBegin(UUID_FIELD_DESC);
oprot.writeString(struct.uuid);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(PARTITION_INTERVAL_FIELD_DESC);
oprot.writeI64(struct.partitionInterval);
oprot.writeFieldEnd();
if (struct.version != null) {
oprot.writeFieldBegin(VERSION_FIELD_DESC);
oprot.writeString(struct.version);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ConfirmInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ConfirmInfoTupleScheme getScheme() {
return new ConfirmInfoTupleScheme();
}
}
private static class ConfirmInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ConfirmInfo 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.isSetAddress()) {
optionals.set(0);
}
if (struct.isSetUuid()) {
optionals.set(1);
}
if (struct.isSetPartitionInterval()) {
optionals.set(2);
}
if (struct.isSetVersion()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetAddress()) {
oprot.writeString(struct.address);
}
if (struct.isSetUuid()) {
oprot.writeString(struct.uuid);
}
if (struct.isSetPartitionInterval()) {
oprot.writeI64(struct.partitionInterval);
}
if (struct.isSetVersion()) {
oprot.writeString(struct.version);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ConfirmInfo struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.address = iprot.readString();
struct.setAddressIsSet(true);
}
if (incoming.get(1)) {
struct.uuid = iprot.readString();
struct.setUuidIsSet(true);
}
if (incoming.get(2)) {
struct.partitionInterval = iprot.readI64();
struct.setPartitionIntervalIsSet(true);
}
if (incoming.get(3)) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
}
}
}
private static 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();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy