org.apache.iotdb.common.rpc.thrift.TTestConnectionResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotdb-thrift-commons Show documentation
Show all versions of iotdb-thrift-commons Show documentation
RPC (Thrift) common framework.
The newest version!
/**
* 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.common.rpc.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2024-09-12")
public class TTestConnectionResult 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("TTestConnectionResult");
private static final org.apache.thrift.protocol.TField SERVICE_PROVIDER_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceProvider", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField SENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("sender", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)3);
private static final org.apache.thrift.protocol.TField REASON_FIELD_DESC = new org.apache.thrift.protocol.TField("reason", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTestConnectionResultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTestConnectionResultTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable TServiceProvider serviceProvider; // required
public @org.apache.thrift.annotation.Nullable TSender sender; // required
public boolean success; // required
public @org.apache.thrift.annotation.Nullable java.lang.String reason; // 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 {
SERVICE_PROVIDER((short)1, "serviceProvider"),
SENDER((short)2, "sender"),
SUCCESS((short)3, "success"),
REASON((short)4, "reason");
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: // SERVICE_PROVIDER
return SERVICE_PROVIDER;
case 2: // SENDER
return SENDER;
case 3: // SUCCESS
return SUCCESS;
case 4: // REASON
return REASON;
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 __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.REASON};
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.SERVICE_PROVIDER, new org.apache.thrift.meta_data.FieldMetaData("serviceProvider", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TServiceProvider.class)));
tmpMap.put(_Fields.SENDER, new org.apache.thrift.meta_data.FieldMetaData("sender", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSender.class)));
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.REASON, new org.apache.thrift.meta_data.FieldMetaData("reason", org.apache.thrift.TFieldRequirementType.OPTIONAL,
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(TTestConnectionResult.class, metaDataMap);
}
public TTestConnectionResult() {
}
public TTestConnectionResult(
TServiceProvider serviceProvider,
TSender sender,
boolean success)
{
this();
this.serviceProvider = serviceProvider;
this.sender = sender;
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on other.
*/
public TTestConnectionResult(TTestConnectionResult other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetServiceProvider()) {
this.serviceProvider = new TServiceProvider(other.serviceProvider);
}
if (other.isSetSender()) {
this.sender = new TSender(other.sender);
}
this.success = other.success;
if (other.isSetReason()) {
this.reason = other.reason;
}
}
public TTestConnectionResult deepCopy() {
return new TTestConnectionResult(this);
}
@Override
public void clear() {
this.serviceProvider = null;
this.sender = null;
setSuccessIsSet(false);
this.success = false;
this.reason = null;
}
@org.apache.thrift.annotation.Nullable
public TServiceProvider getServiceProvider() {
return this.serviceProvider;
}
public TTestConnectionResult setServiceProvider(@org.apache.thrift.annotation.Nullable TServiceProvider serviceProvider) {
this.serviceProvider = serviceProvider;
return this;
}
public void unsetServiceProvider() {
this.serviceProvider = null;
}
/** Returns true if field serviceProvider is set (has been assigned a value) and false otherwise */
public boolean isSetServiceProvider() {
return this.serviceProvider != null;
}
public void setServiceProviderIsSet(boolean value) {
if (!value) {
this.serviceProvider = null;
}
}
@org.apache.thrift.annotation.Nullable
public TSender getSender() {
return this.sender;
}
public TTestConnectionResult setSender(@org.apache.thrift.annotation.Nullable TSender sender) {
this.sender = sender;
return this;
}
public void unsetSender() {
this.sender = null;
}
/** Returns true if field sender is set (has been assigned a value) and false otherwise */
public boolean isSetSender() {
return this.sender != null;
}
public void setSenderIsSet(boolean value) {
if (!value) {
this.sender = null;
}
}
public boolean isSuccess() {
return this.success;
}
public TTestConnectionResult setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getReason() {
return this.reason;
}
public TTestConnectionResult setReason(@org.apache.thrift.annotation.Nullable java.lang.String reason) {
this.reason = reason;
return this;
}
public void unsetReason() {
this.reason = null;
}
/** Returns true if field reason is set (has been assigned a value) and false otherwise */
public boolean isSetReason() {
return this.reason != null;
}
public void setReasonIsSet(boolean value) {
if (!value) {
this.reason = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SERVICE_PROVIDER:
if (value == null) {
unsetServiceProvider();
} else {
setServiceProvider((TServiceProvider)value);
}
break;
case SENDER:
if (value == null) {
unsetSender();
} else {
setSender((TSender)value);
}
break;
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
case REASON:
if (value == null) {
unsetReason();
} else {
setReason((java.lang.String)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SERVICE_PROVIDER:
return getServiceProvider();
case SENDER:
return getSender();
case SUCCESS:
return isSuccess();
case REASON:
return getReason();
}
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 SERVICE_PROVIDER:
return isSetServiceProvider();
case SENDER:
return isSetSender();
case SUCCESS:
return isSetSuccess();
case REASON:
return isSetReason();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TTestConnectionResult)
return this.equals((TTestConnectionResult)that);
return false;
}
public boolean equals(TTestConnectionResult that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_serviceProvider = true && this.isSetServiceProvider();
boolean that_present_serviceProvider = true && that.isSetServiceProvider();
if (this_present_serviceProvider || that_present_serviceProvider) {
if (!(this_present_serviceProvider && that_present_serviceProvider))
return false;
if (!this.serviceProvider.equals(that.serviceProvider))
return false;
}
boolean this_present_sender = true && this.isSetSender();
boolean that_present_sender = true && that.isSetSender();
if (this_present_sender || that_present_sender) {
if (!(this_present_sender && that_present_sender))
return false;
if (!this.sender.equals(that.sender))
return false;
}
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
boolean this_present_reason = true && this.isSetReason();
boolean that_present_reason = true && that.isSetReason();
if (this_present_reason || that_present_reason) {
if (!(this_present_reason && that_present_reason))
return false;
if (!this.reason.equals(that.reason))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetServiceProvider()) ? 131071 : 524287);
if (isSetServiceProvider())
hashCode = hashCode * 8191 + serviceProvider.hashCode();
hashCode = hashCode * 8191 + ((isSetSender()) ? 131071 : 524287);
if (isSetSender())
hashCode = hashCode * 8191 + sender.hashCode();
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
hashCode = hashCode * 8191 + ((isSetReason()) ? 131071 : 524287);
if (isSetReason())
hashCode = hashCode * 8191 + reason.hashCode();
return hashCode;
}
@Override
public int compareTo(TTestConnectionResult other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetServiceProvider(), other.isSetServiceProvider());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceProvider()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceProvider, other.serviceProvider);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetSender(), other.isSetSender());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSender()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sender, other.sender);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetReason(), other.isSetReason());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReason()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reason, other.reason);
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("TTestConnectionResult(");
boolean first = true;
sb.append("serviceProvider:");
if (this.serviceProvider == null) {
sb.append("null");
} else {
sb.append(this.serviceProvider);
}
first = false;
if (!first) sb.append(", ");
sb.append("sender:");
if (this.sender == null) {
sb.append("null");
} else {
sb.append(this.sender);
}
first = false;
if (!first) sb.append(", ");
sb.append("success:");
sb.append(this.success);
first = false;
if (isSetReason()) {
if (!first) sb.append(", ");
sb.append("reason:");
if (this.reason == null) {
sb.append("null");
} else {
sb.append(this.reason);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (serviceProvider == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'serviceProvider' was not present! Struct: " + toString());
}
if (sender == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sender' was not present! Struct: " + toString());
}
// alas, we cannot check 'success' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
if (serviceProvider != null) {
serviceProvider.validate();
}
if (sender != null) {
sender.validate();
}
}
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 TTestConnectionResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TTestConnectionResultStandardScheme getScheme() {
return new TTestConnectionResultStandardScheme();
}
}
private static class TTestConnectionResultStandardScheme extends org.apache.thrift.scheme.StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, TTestConnectionResult 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: // SERVICE_PROVIDER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.serviceProvider = new TServiceProvider();
struct.serviceProvider.read(iprot);
struct.setServiceProviderIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // SENDER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.sender = new TSender();
struct.sender.read(iprot);
struct.setSenderIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // REASON
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.reason = iprot.readString();
struct.setReasonIsSet(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
if (!struct.isSetSuccess()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'success' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TTestConnectionResult struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.serviceProvider != null) {
oprot.writeFieldBegin(SERVICE_PROVIDER_FIELD_DESC);
struct.serviceProvider.write(oprot);
oprot.writeFieldEnd();
}
if (struct.sender != null) {
oprot.writeFieldBegin(SENDER_FIELD_DESC);
struct.sender.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
if (struct.reason != null) {
if (struct.isSetReason()) {
oprot.writeFieldBegin(REASON_FIELD_DESC);
oprot.writeString(struct.reason);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TTestConnectionResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TTestConnectionResultTupleScheme getScheme() {
return new TTestConnectionResultTupleScheme();
}
}
private static class TTestConnectionResultTupleScheme extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TTestConnectionResult struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.serviceProvider.write(oprot);
struct.sender.write(oprot);
oprot.writeBool(struct.success);
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetReason()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetReason()) {
oprot.writeString(struct.reason);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TTestConnectionResult struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.serviceProvider = new TServiceProvider();
struct.serviceProvider.read(iprot);
struct.setServiceProviderIsSet(true);
struct.sender = new TSender();
struct.sender.read(iprot);
struct.setSenderIsSet(true);
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.reason = iprot.readString();
struct.setReasonIsSet(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();
}
}