io.snappydata.thrift.PrepareResult Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package io.snappydata.thrift;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2019-08-09")
public class PrepareResult 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("PrepareResult");
private static final org.apache.thrift.protocol.TField STATEMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("statementId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField STATEMENT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("statementType", org.apache.thrift.protocol.TType.BYTE, (short)2);
private static final org.apache.thrift.protocol.TField PARAMETER_META_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterMetaData", org.apache.thrift.protocol.TType.LIST, (short)3);
private static final org.apache.thrift.protocol.TField RESULT_SET_META_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("resultSetMetaData", org.apache.thrift.protocol.TType.LIST, (short)4);
private static final org.apache.thrift.protocol.TField WARNINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("warnings", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new PrepareResultStandardSchemeFactory());
schemes.put(TupleScheme.class, new PrepareResultTupleSchemeFactory());
}
public long statementId; // required
public byte statementType; // required
public List parameterMetaData; // required
public List resultSetMetaData; // optional
public SnappyExceptionData warnings; // 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 {
STATEMENT_ID((short)1, "statementId"),
STATEMENT_TYPE((short)2, "statementType"),
PARAMETER_META_DATA((short)3, "parameterMetaData"),
RESULT_SET_META_DATA((short)4, "resultSetMetaData"),
WARNINGS((short)5, "warnings");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // STATEMENT_ID
return STATEMENT_ID;
case 2: // STATEMENT_TYPE
return STATEMENT_TYPE;
case 3: // PARAMETER_META_DATA
return PARAMETER_META_DATA;
case 4: // RESULT_SET_META_DATA
return RESULT_SET_META_DATA;
case 5: // WARNINGS
return WARNINGS;
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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __STATEMENTID_ISSET_ID = 0;
private static final int __STATEMENTTYPE_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.RESULT_SET_META_DATA,_Fields.WARNINGS};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.STATEMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("statementId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.STATEMENT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("statementType", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.PARAMETER_META_DATA, new org.apache.thrift.meta_data.FieldMetaData("parameterMetaData", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnDescriptor.class))));
tmpMap.put(_Fields.RESULT_SET_META_DATA, new org.apache.thrift.meta_data.FieldMetaData("resultSetMetaData", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnDescriptor.class))));
tmpMap.put(_Fields.WARNINGS, new org.apache.thrift.meta_data.FieldMetaData("warnings", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SnappyExceptionData.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PrepareResult.class, metaDataMap);
}
public PrepareResult() {
}
public PrepareResult(
long statementId,
byte statementType,
List parameterMetaData)
{
this();
this.statementId = statementId;
setStatementIdIsSet(true);
this.statementType = statementType;
setStatementTypeIsSet(true);
this.parameterMetaData = parameterMetaData;
}
/**
* Performs a deep copy on other.
*/
public PrepareResult(PrepareResult other) {
__isset_bitfield = other.__isset_bitfield;
this.statementId = other.statementId;
this.statementType = other.statementType;
if (other.isSetParameterMetaData()) {
List __this__parameterMetaData = new ArrayList(other.parameterMetaData.size());
for (ColumnDescriptor other_element : other.parameterMetaData) {
__this__parameterMetaData.add(new ColumnDescriptor(other_element));
}
this.parameterMetaData = __this__parameterMetaData;
}
if (other.isSetResultSetMetaData()) {
List __this__resultSetMetaData = new ArrayList(other.resultSetMetaData.size());
for (ColumnDescriptor other_element : other.resultSetMetaData) {
__this__resultSetMetaData.add(new ColumnDescriptor(other_element));
}
this.resultSetMetaData = __this__resultSetMetaData;
}
if (other.isSetWarnings()) {
this.warnings = new SnappyExceptionData(other.warnings);
}
}
public PrepareResult deepCopy() {
return new PrepareResult(this);
}
@Override
public void clear() {
setStatementIdIsSet(false);
this.statementId = 0;
setStatementTypeIsSet(false);
this.statementType = 0;
this.parameterMetaData = null;
this.resultSetMetaData = null;
this.warnings = null;
}
public long getStatementId() {
return this.statementId;
}
public PrepareResult setStatementId(long statementId) {
this.statementId = statementId;
setStatementIdIsSet(true);
return this;
}
public void unsetStatementId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STATEMENTID_ISSET_ID);
}
/** Returns true if field statementId is set (has been assigned a value) and false otherwise */
public boolean isSetStatementId() {
return EncodingUtils.testBit(__isset_bitfield, __STATEMENTID_ISSET_ID);
}
public void setStatementIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STATEMENTID_ISSET_ID, value);
}
public byte getStatementType() {
return this.statementType;
}
public PrepareResult setStatementType(byte statementType) {
this.statementType = statementType;
setStatementTypeIsSet(true);
return this;
}
public void unsetStatementType() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STATEMENTTYPE_ISSET_ID);
}
/** Returns true if field statementType is set (has been assigned a value) and false otherwise */
public boolean isSetStatementType() {
return EncodingUtils.testBit(__isset_bitfield, __STATEMENTTYPE_ISSET_ID);
}
public void setStatementTypeIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STATEMENTTYPE_ISSET_ID, value);
}
public int getParameterMetaDataSize() {
return (this.parameterMetaData == null) ? 0 : this.parameterMetaData.size();
}
public java.util.Iterator getParameterMetaDataIterator() {
return (this.parameterMetaData == null) ? null : this.parameterMetaData.iterator();
}
public void addToParameterMetaData(ColumnDescriptor elem) {
if (this.parameterMetaData == null) {
this.parameterMetaData = new ArrayList();
}
this.parameterMetaData.add(elem);
}
public List getParameterMetaData() {
return this.parameterMetaData;
}
public PrepareResult setParameterMetaData(List parameterMetaData) {
this.parameterMetaData = parameterMetaData;
return this;
}
public void unsetParameterMetaData() {
this.parameterMetaData = null;
}
/** Returns true if field parameterMetaData is set (has been assigned a value) and false otherwise */
public boolean isSetParameterMetaData() {
return this.parameterMetaData != null;
}
public void setParameterMetaDataIsSet(boolean value) {
if (!value) {
this.parameterMetaData = null;
}
}
public int getResultSetMetaDataSize() {
return (this.resultSetMetaData == null) ? 0 : this.resultSetMetaData.size();
}
public java.util.Iterator getResultSetMetaDataIterator() {
return (this.resultSetMetaData == null) ? null : this.resultSetMetaData.iterator();
}
public void addToResultSetMetaData(ColumnDescriptor elem) {
if (this.resultSetMetaData == null) {
this.resultSetMetaData = new ArrayList();
}
this.resultSetMetaData.add(elem);
}
public List getResultSetMetaData() {
return this.resultSetMetaData;
}
public PrepareResult setResultSetMetaData(List resultSetMetaData) {
this.resultSetMetaData = resultSetMetaData;
return this;
}
public void unsetResultSetMetaData() {
this.resultSetMetaData = null;
}
/** Returns true if field resultSetMetaData is set (has been assigned a value) and false otherwise */
public boolean isSetResultSetMetaData() {
return this.resultSetMetaData != null;
}
public void setResultSetMetaDataIsSet(boolean value) {
if (!value) {
this.resultSetMetaData = null;
}
}
public SnappyExceptionData getWarnings() {
return this.warnings;
}
public PrepareResult setWarnings(SnappyExceptionData warnings) {
this.warnings = warnings;
return this;
}
public void unsetWarnings() {
this.warnings = null;
}
/** Returns true if field warnings is set (has been assigned a value) and false otherwise */
public boolean isSetWarnings() {
return this.warnings != null;
}
public void setWarningsIsSet(boolean value) {
if (!value) {
this.warnings = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case STATEMENT_ID:
if (value == null) {
unsetStatementId();
} else {
setStatementId((Long)value);
}
break;
case STATEMENT_TYPE:
if (value == null) {
unsetStatementType();
} else {
setStatementType((Byte)value);
}
break;
case PARAMETER_META_DATA:
if (value == null) {
unsetParameterMetaData();
} else {
setParameterMetaData((List)value);
}
break;
case RESULT_SET_META_DATA:
if (value == null) {
unsetResultSetMetaData();
} else {
setResultSetMetaData((List)value);
}
break;
case WARNINGS:
if (value == null) {
unsetWarnings();
} else {
setWarnings((SnappyExceptionData)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case STATEMENT_ID:
return getStatementId();
case STATEMENT_TYPE:
return getStatementType();
case PARAMETER_META_DATA:
return getParameterMetaData();
case RESULT_SET_META_DATA:
return getResultSetMetaData();
case WARNINGS:
return getWarnings();
}
throw new 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 IllegalArgumentException();
}
switch (field) {
case STATEMENT_ID:
return isSetStatementId();
case STATEMENT_TYPE:
return isSetStatementType();
case PARAMETER_META_DATA:
return isSetParameterMetaData();
case RESULT_SET_META_DATA:
return isSetResultSetMetaData();
case WARNINGS:
return isSetWarnings();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof PrepareResult)
return this.equals((PrepareResult)that);
return false;
}
public boolean equals(PrepareResult that) {
if (that == null)
return false;
boolean this_present_statementId = true;
boolean that_present_statementId = true;
if (this_present_statementId || that_present_statementId) {
if (!(this_present_statementId && that_present_statementId))
return false;
if (this.statementId != that.statementId)
return false;
}
boolean this_present_statementType = true;
boolean that_present_statementType = true;
if (this_present_statementType || that_present_statementType) {
if (!(this_present_statementType && that_present_statementType))
return false;
if (this.statementType != that.statementType)
return false;
}
boolean this_present_parameterMetaData = true && this.isSetParameterMetaData();
boolean that_present_parameterMetaData = true && that.isSetParameterMetaData();
if (this_present_parameterMetaData || that_present_parameterMetaData) {
if (!(this_present_parameterMetaData && that_present_parameterMetaData))
return false;
if (!this.parameterMetaData.equals(that.parameterMetaData))
return false;
}
boolean this_present_resultSetMetaData = true && this.isSetResultSetMetaData();
boolean that_present_resultSetMetaData = true && that.isSetResultSetMetaData();
if (this_present_resultSetMetaData || that_present_resultSetMetaData) {
if (!(this_present_resultSetMetaData && that_present_resultSetMetaData))
return false;
if (!this.resultSetMetaData.equals(that.resultSetMetaData))
return false;
}
boolean this_present_warnings = true && this.isSetWarnings();
boolean that_present_warnings = true && that.isSetWarnings();
if (this_present_warnings || that_present_warnings) {
if (!(this_present_warnings && that_present_warnings))
return false;
if (!this.warnings.equals(that.warnings))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy