org.apache.cassandra.thrift.CqlResult Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (1.0.0-dev)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.cassandra.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", "unused"})
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2016-02-10")
public class CqlResult 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("CqlResult");
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("num", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new CqlResultStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new CqlResultTupleSchemeFactory();
/**
*
* @see CqlResultType
*/
public CqlResultType type; // required
public List rows; // optional
public int num; // optional
public CqlMetadata schema; // 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 {
/**
*
* @see CqlResultType
*/
TYPE((short)1, "type"),
ROWS((short)2, "rows"),
NUM((short)3, "num"),
SCHEMA((short)4, "schema");
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: // TYPE
return TYPE;
case 2: // ROWS
return ROWS;
case 3: // NUM
return NUM;
case 4: // SCHEMA
return SCHEMA;
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 __NUM_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.ROWS,_Fields.NUM,_Fields.SCHEMA};
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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CqlResultType.class)));
tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", 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, CqlRow.class))));
tmpMap.put(_Fields.NUM, new org.apache.thrift.meta_data.FieldMetaData("num", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CqlMetadata.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CqlResult.class, metaDataMap);
}
public CqlResult() {
}
public CqlResult(
CqlResultType type)
{
this();
this.type = type;
}
/**
* Performs a deep copy on other.
*/
public CqlResult(CqlResult other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetType()) {
this.type = other.type;
}
if (other.isSetRows()) {
List __this__rows = new ArrayList(other.rows.size());
for (CqlRow other_element : other.rows) {
__this__rows.add(new CqlRow(other_element));
}
this.rows = __this__rows;
}
this.num = other.num;
if (other.isSetSchema()) {
this.schema = new CqlMetadata(other.schema);
}
}
public CqlResult deepCopy() {
return new CqlResult(this);
}
@Override
public void clear() {
this.type = null;
this.rows = null;
setNumIsSet(false);
this.num = 0;
this.schema = null;
}
/**
*
* @see CqlResultType
*/
public CqlResultType getType() {
return this.type;
}
/**
*
* @see CqlResultType
*/
public CqlResult setType(CqlResultType type) {
this.type = type;
return this;
}
public void unsetType() {
this.type = null;
}
/** Returns true if field type is set (has been assigned a value) and false otherwise */
public boolean isSetType() {
return this.type != null;
}
public void setTypeIsSet(boolean value) {
if (!value) {
this.type = null;
}
}
public int getRowsSize() {
return (this.rows == null) ? 0 : this.rows.size();
}
public java.util.Iterator getRowsIterator() {
return (this.rows == null) ? null : this.rows.iterator();
}
public void addToRows(CqlRow elem) {
if (this.rows == null) {
this.rows = new ArrayList();
}
this.rows.add(elem);
}
public List getRows() {
return this.rows;
}
public CqlResult setRows(List rows) {
this.rows = rows;
return this;
}
public void unsetRows() {
this.rows = null;
}
/** Returns true if field rows is set (has been assigned a value) and false otherwise */
public boolean isSetRows() {
return this.rows != null;
}
public void setRowsIsSet(boolean value) {
if (!value) {
this.rows = null;
}
}
public int getNum() {
return this.num;
}
public CqlResult setNum(int num) {
this.num = num;
setNumIsSet(true);
return this;
}
public void unsetNum() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_ISSET_ID);
}
/** Returns true if field num is set (has been assigned a value) and false otherwise */
public boolean isSetNum() {
return EncodingUtils.testBit(__isset_bitfield, __NUM_ISSET_ID);
}
public void setNumIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_ISSET_ID, value);
}
public CqlMetadata getSchema() {
return this.schema;
}
public CqlResult setSchema(CqlMetadata schema) {
this.schema = schema;
return this;
}
public void unsetSchema() {
this.schema = null;
}
/** Returns true if field schema is set (has been assigned a value) and false otherwise */
public boolean isSetSchema() {
return this.schema != null;
}
public void setSchemaIsSet(boolean value) {
if (!value) {
this.schema = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TYPE:
if (value == null) {
unsetType();
} else {
setType((CqlResultType)value);
}
break;
case ROWS:
if (value == null) {
unsetRows();
} else {
setRows((List)value);
}
break;
case NUM:
if (value == null) {
unsetNum();
} else {
setNum((Integer)value);
}
break;
case SCHEMA:
if (value == null) {
unsetSchema();
} else {
setSchema((CqlMetadata)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TYPE:
return getType();
case ROWS:
return getRows();
case NUM:
return getNum();
case SCHEMA:
return getSchema();
}
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 TYPE:
return isSetType();
case ROWS:
return isSetRows();
case NUM:
return isSetNum();
case SCHEMA:
return isSetSchema();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof CqlResult)
return this.equals((CqlResult)that);
return false;
}
public boolean equals(CqlResult that) {
if (that == null)
return false;
boolean this_present_type = true && this.isSetType();
boolean that_present_type = true && that.isSetType();
if (this_present_type || that_present_type) {
if (!(this_present_type && that_present_type))
return false;
if (!this.type.equals(that.type))
return false;
}
boolean this_present_rows = true && this.isSetRows();
boolean that_present_rows = true && that.isSetRows();
if (this_present_rows || that_present_rows) {
if (!(this_present_rows && that_present_rows))
return false;
if (!this.rows.equals(that.rows))
return false;
}
boolean this_present_num = true && this.isSetNum();
boolean that_present_num = true && that.isSetNum();
if (this_present_num || that_present_num) {
if (!(this_present_num && that_present_num))
return false;
if (this.num != that.num)
return false;
}
boolean this_present_schema = true && this.isSetSchema();
boolean that_present_schema = true && that.isSetSchema();
if (this_present_schema || that_present_schema) {
if (!(this_present_schema && that_present_schema))
return false;
if (!this.schema.equals(that.schema))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy