org.apache.cassandra.thrift.KsDef 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 KsDef 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("KsDef");
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField STRATEGY_CLASS_FIELD_DESC = new org.apache.thrift.protocol.TField("strategy_class", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField STRATEGY_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("strategy_options", org.apache.thrift.protocol.TType.MAP, (short)3);
private static final org.apache.thrift.protocol.TField REPLICATION_FACTOR_FIELD_DESC = new org.apache.thrift.protocol.TField("replication_factor", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField CF_DEFS_FIELD_DESC = new org.apache.thrift.protocol.TField("cf_defs", org.apache.thrift.protocol.TType.LIST, (short)5);
private static final org.apache.thrift.protocol.TField DURABLE_WRITES_FIELD_DESC = new org.apache.thrift.protocol.TField("durable_writes", org.apache.thrift.protocol.TType.BOOL, (short)6);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new KsDefStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new KsDefTupleSchemeFactory();
public String name; // required
public String strategy_class; // required
public Map strategy_options; // optional
/**
* @deprecated
*/
public int replication_factor; // optional
public List cf_defs; // required
public boolean durable_writes; // 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 {
NAME((short)1, "name"),
STRATEGY_CLASS((short)2, "strategy_class"),
STRATEGY_OPTIONS((short)3, "strategy_options"),
/**
* @deprecated
*/
REPLICATION_FACTOR((short)4, "replication_factor"),
CF_DEFS((short)5, "cf_defs"),
DURABLE_WRITES((short)6, "durable_writes");
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: // NAME
return NAME;
case 2: // STRATEGY_CLASS
return STRATEGY_CLASS;
case 3: // STRATEGY_OPTIONS
return STRATEGY_OPTIONS;
case 4: // REPLICATION_FACTOR
return REPLICATION_FACTOR;
case 5: // CF_DEFS
return CF_DEFS;
case 6: // DURABLE_WRITES
return DURABLE_WRITES;
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 __REPLICATION_FACTOR_ISSET_ID = 0;
private static final int __DURABLE_WRITES_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.STRATEGY_OPTIONS,_Fields.REPLICATION_FACTOR,_Fields.DURABLE_WRITES};
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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.STRATEGY_CLASS, new org.apache.thrift.meta_data.FieldMetaData("strategy_class", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.STRATEGY_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("strategy_options", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.REPLICATION_FACTOR, new org.apache.thrift.meta_data.FieldMetaData("replication_factor", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.CF_DEFS, new org.apache.thrift.meta_data.FieldMetaData("cf_defs", 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, CfDef.class))));
tmpMap.put(_Fields.DURABLE_WRITES, new org.apache.thrift.meta_data.FieldMetaData("durable_writes", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(KsDef.class, metaDataMap);
}
public KsDef() {
this.durable_writes = true;
}
public KsDef(
String name,
String strategy_class,
List cf_defs)
{
this();
this.name = name;
this.strategy_class = strategy_class;
this.cf_defs = cf_defs;
}
/**
* Performs a deep copy on other.
*/
public KsDef(KsDef other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetStrategy_class()) {
this.strategy_class = other.strategy_class;
}
if (other.isSetStrategy_options()) {
Map __this__strategy_options = new HashMap(other.strategy_options);
this.strategy_options = __this__strategy_options;
}
this.replication_factor = other.replication_factor;
if (other.isSetCf_defs()) {
List __this__cf_defs = new ArrayList(other.cf_defs.size());
for (CfDef other_element : other.cf_defs) {
__this__cf_defs.add(new CfDef(other_element));
}
this.cf_defs = __this__cf_defs;
}
this.durable_writes = other.durable_writes;
}
public KsDef deepCopy() {
return new KsDef(this);
}
@Override
public void clear() {
this.name = null;
this.strategy_class = null;
this.strategy_options = null;
setReplication_factorIsSet(false);
this.replication_factor = 0;
this.cf_defs = null;
this.durable_writes = true;
}
public String getName() {
return this.name;
}
public KsDef setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public String getStrategy_class() {
return this.strategy_class;
}
public KsDef setStrategy_class(String strategy_class) {
this.strategy_class = strategy_class;
return this;
}
public void unsetStrategy_class() {
this.strategy_class = null;
}
/** Returns true if field strategy_class is set (has been assigned a value) and false otherwise */
public boolean isSetStrategy_class() {
return this.strategy_class != null;
}
public void setStrategy_classIsSet(boolean value) {
if (!value) {
this.strategy_class = null;
}
}
public int getStrategy_optionsSize() {
return (this.strategy_options == null) ? 0 : this.strategy_options.size();
}
public void putToStrategy_options(String key, String val) {
if (this.strategy_options == null) {
this.strategy_options = new HashMap();
}
this.strategy_options.put(key, val);
}
public Map getStrategy_options() {
return this.strategy_options;
}
public KsDef setStrategy_options(Map strategy_options) {
this.strategy_options = strategy_options;
return this;
}
public void unsetStrategy_options() {
this.strategy_options = null;
}
/** Returns true if field strategy_options is set (has been assigned a value) and false otherwise */
public boolean isSetStrategy_options() {
return this.strategy_options != null;
}
public void setStrategy_optionsIsSet(boolean value) {
if (!value) {
this.strategy_options = null;
}
}
/**
* @deprecated
*/
public int getReplication_factor() {
return this.replication_factor;
}
/**
* @deprecated
*/
public KsDef setReplication_factor(int replication_factor) {
this.replication_factor = replication_factor;
setReplication_factorIsSet(true);
return this;
}
public void unsetReplication_factor() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID);
}
/** Returns true if field replication_factor is set (has been assigned a value) and false otherwise */
public boolean isSetReplication_factor() {
return EncodingUtils.testBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID);
}
public void setReplication_factorIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID, value);
}
public int getCf_defsSize() {
return (this.cf_defs == null) ? 0 : this.cf_defs.size();
}
public java.util.Iterator getCf_defsIterator() {
return (this.cf_defs == null) ? null : this.cf_defs.iterator();
}
public void addToCf_defs(CfDef elem) {
if (this.cf_defs == null) {
this.cf_defs = new ArrayList();
}
this.cf_defs.add(elem);
}
public List getCf_defs() {
return this.cf_defs;
}
public KsDef setCf_defs(List cf_defs) {
this.cf_defs = cf_defs;
return this;
}
public void unsetCf_defs() {
this.cf_defs = null;
}
/** Returns true if field cf_defs is set (has been assigned a value) and false otherwise */
public boolean isSetCf_defs() {
return this.cf_defs != null;
}
public void setCf_defsIsSet(boolean value) {
if (!value) {
this.cf_defs = null;
}
}
public boolean isDurable_writes() {
return this.durable_writes;
}
public KsDef setDurable_writes(boolean durable_writes) {
this.durable_writes = durable_writes;
setDurable_writesIsSet(true);
return this;
}
public void unsetDurable_writes() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DURABLE_WRITES_ISSET_ID);
}
/** Returns true if field durable_writes is set (has been assigned a value) and false otherwise */
public boolean isSetDurable_writes() {
return EncodingUtils.testBit(__isset_bitfield, __DURABLE_WRITES_ISSET_ID);
}
public void setDurable_writesIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DURABLE_WRITES_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case STRATEGY_CLASS:
if (value == null) {
unsetStrategy_class();
} else {
setStrategy_class((String)value);
}
break;
case STRATEGY_OPTIONS:
if (value == null) {
unsetStrategy_options();
} else {
setStrategy_options((Map)value);
}
break;
case REPLICATION_FACTOR:
if (value == null) {
unsetReplication_factor();
} else {
setReplication_factor((Integer)value);
}
break;
case CF_DEFS:
if (value == null) {
unsetCf_defs();
} else {
setCf_defs((List)value);
}
break;
case DURABLE_WRITES:
if (value == null) {
unsetDurable_writes();
} else {
setDurable_writes((Boolean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
return getName();
case STRATEGY_CLASS:
return getStrategy_class();
case STRATEGY_OPTIONS:
return getStrategy_options();
case REPLICATION_FACTOR:
return getReplication_factor();
case CF_DEFS:
return getCf_defs();
case DURABLE_WRITES:
return isDurable_writes();
}
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 NAME:
return isSetName();
case STRATEGY_CLASS:
return isSetStrategy_class();
case STRATEGY_OPTIONS:
return isSetStrategy_options();
case REPLICATION_FACTOR:
return isSetReplication_factor();
case CF_DEFS:
return isSetCf_defs();
case DURABLE_WRITES:
return isSetDurable_writes();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof KsDef)
return this.equals((KsDef)that);
return false;
}
public boolean equals(KsDef that) {
if (that == null)
return false;
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_strategy_class = true && this.isSetStrategy_class();
boolean that_present_strategy_class = true && that.isSetStrategy_class();
if (this_present_strategy_class || that_present_strategy_class) {
if (!(this_present_strategy_class && that_present_strategy_class))
return false;
if (!this.strategy_class.equals(that.strategy_class))
return false;
}
boolean this_present_strategy_options = true && this.isSetStrategy_options();
boolean that_present_strategy_options = true && that.isSetStrategy_options();
if (this_present_strategy_options || that_present_strategy_options) {
if (!(this_present_strategy_options && that_present_strategy_options))
return false;
if (!this.strategy_options.equals(that.strategy_options))
return false;
}
boolean this_present_replication_factor = true && this.isSetReplication_factor();
boolean that_present_replication_factor = true && that.isSetReplication_factor();
if (this_present_replication_factor || that_present_replication_factor) {
if (!(this_present_replication_factor && that_present_replication_factor))
return false;
if (this.replication_factor != that.replication_factor)
return false;
}
boolean this_present_cf_defs = true && this.isSetCf_defs();
boolean that_present_cf_defs = true && that.isSetCf_defs();
if (this_present_cf_defs || that_present_cf_defs) {
if (!(this_present_cf_defs && that_present_cf_defs))
return false;
if (!this.cf_defs.equals(that.cf_defs))
return false;
}
boolean this_present_durable_writes = true && this.isSetDurable_writes();
boolean that_present_durable_writes = true && that.isSetDurable_writes();
if (this_present_durable_writes || that_present_durable_writes) {
if (!(this_present_durable_writes && that_present_durable_writes))
return false;
if (this.durable_writes != that.durable_writes)
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy