org.apache.cassandra.thrift.CqlMetadata 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 CqlMetadata 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("CqlMetadata");
private static final org.apache.thrift.protocol.TField NAME_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("name_types", org.apache.thrift.protocol.TType.MAP, (short)1);
private static final org.apache.thrift.protocol.TField VALUE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("value_types", org.apache.thrift.protocol.TType.MAP, (short)2);
private static final org.apache.thrift.protocol.TField DEFAULT_NAME_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("default_name_type", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField DEFAULT_VALUE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("default_value_type", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new CqlMetadataStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new CqlMetadataTupleSchemeFactory();
public Map name_types; // required
public Map value_types; // required
public String default_name_type; // required
public String default_value_type; // 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 {
NAME_TYPES((short)1, "name_types"),
VALUE_TYPES((short)2, "value_types"),
DEFAULT_NAME_TYPE((short)3, "default_name_type"),
DEFAULT_VALUE_TYPE((short)4, "default_value_type");
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_TYPES
return NAME_TYPES;
case 2: // VALUE_TYPES
return VALUE_TYPES;
case 3: // DEFAULT_NAME_TYPE
return DEFAULT_NAME_TYPE;
case 4: // DEFAULT_VALUE_TYPE
return DEFAULT_VALUE_TYPE;
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
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_TYPES, new org.apache.thrift.meta_data.FieldMetaData("name_types", org.apache.thrift.TFieldRequirementType.REQUIRED,
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 , true),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.VALUE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("value_types", org.apache.thrift.TFieldRequirementType.REQUIRED,
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 , true),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.DEFAULT_NAME_TYPE, new org.apache.thrift.meta_data.FieldMetaData("default_name_type", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DEFAULT_VALUE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("default_value_type", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CqlMetadata.class, metaDataMap);
}
public CqlMetadata() {
}
public CqlMetadata(
Map name_types,
Map value_types,
String default_name_type,
String default_value_type)
{
this();
this.name_types = name_types;
this.value_types = value_types;
this.default_name_type = default_name_type;
this.default_value_type = default_value_type;
}
/**
* Performs a deep copy on other.
*/
public CqlMetadata(CqlMetadata other) {
if (other.isSetName_types()) {
Map __this__name_types = new HashMap(other.name_types);
this.name_types = __this__name_types;
}
if (other.isSetValue_types()) {
Map __this__value_types = new HashMap(other.value_types);
this.value_types = __this__value_types;
}
if (other.isSetDefault_name_type()) {
this.default_name_type = other.default_name_type;
}
if (other.isSetDefault_value_type()) {
this.default_value_type = other.default_value_type;
}
}
public CqlMetadata deepCopy() {
return new CqlMetadata(this);
}
@Override
public void clear() {
this.name_types = null;
this.value_types = null;
this.default_name_type = null;
this.default_value_type = null;
}
public int getName_typesSize() {
return (this.name_types == null) ? 0 : this.name_types.size();
}
public void putToName_types(ByteBuffer key, String val) {
if (this.name_types == null) {
this.name_types = new HashMap();
}
this.name_types.put(key, val);
}
public Map getName_types() {
return this.name_types;
}
public CqlMetadata setName_types(Map name_types) {
this.name_types = name_types;
return this;
}
public void unsetName_types() {
this.name_types = null;
}
/** Returns true if field name_types is set (has been assigned a value) and false otherwise */
public boolean isSetName_types() {
return this.name_types != null;
}
public void setName_typesIsSet(boolean value) {
if (!value) {
this.name_types = null;
}
}
public int getValue_typesSize() {
return (this.value_types == null) ? 0 : this.value_types.size();
}
public void putToValue_types(ByteBuffer key, String val) {
if (this.value_types == null) {
this.value_types = new HashMap();
}
this.value_types.put(key, val);
}
public Map getValue_types() {
return this.value_types;
}
public CqlMetadata setValue_types(Map value_types) {
this.value_types = value_types;
return this;
}
public void unsetValue_types() {
this.value_types = null;
}
/** Returns true if field value_types is set (has been assigned a value) and false otherwise */
public boolean isSetValue_types() {
return this.value_types != null;
}
public void setValue_typesIsSet(boolean value) {
if (!value) {
this.value_types = null;
}
}
public String getDefault_name_type() {
return this.default_name_type;
}
public CqlMetadata setDefault_name_type(String default_name_type) {
this.default_name_type = default_name_type;
return this;
}
public void unsetDefault_name_type() {
this.default_name_type = null;
}
/** Returns true if field default_name_type is set (has been assigned a value) and false otherwise */
public boolean isSetDefault_name_type() {
return this.default_name_type != null;
}
public void setDefault_name_typeIsSet(boolean value) {
if (!value) {
this.default_name_type = null;
}
}
public String getDefault_value_type() {
return this.default_value_type;
}
public CqlMetadata setDefault_value_type(String default_value_type) {
this.default_value_type = default_value_type;
return this;
}
public void unsetDefault_value_type() {
this.default_value_type = null;
}
/** Returns true if field default_value_type is set (has been assigned a value) and false otherwise */
public boolean isSetDefault_value_type() {
return this.default_value_type != null;
}
public void setDefault_value_typeIsSet(boolean value) {
if (!value) {
this.default_value_type = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME_TYPES:
if (value == null) {
unsetName_types();
} else {
setName_types((Map)value);
}
break;
case VALUE_TYPES:
if (value == null) {
unsetValue_types();
} else {
setValue_types((Map)value);
}
break;
case DEFAULT_NAME_TYPE:
if (value == null) {
unsetDefault_name_type();
} else {
setDefault_name_type((String)value);
}
break;
case DEFAULT_VALUE_TYPE:
if (value == null) {
unsetDefault_value_type();
} else {
setDefault_value_type((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME_TYPES:
return getName_types();
case VALUE_TYPES:
return getValue_types();
case DEFAULT_NAME_TYPE:
return getDefault_name_type();
case DEFAULT_VALUE_TYPE:
return getDefault_value_type();
}
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_TYPES:
return isSetName_types();
case VALUE_TYPES:
return isSetValue_types();
case DEFAULT_NAME_TYPE:
return isSetDefault_name_type();
case DEFAULT_VALUE_TYPE:
return isSetDefault_value_type();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof CqlMetadata)
return this.equals((CqlMetadata)that);
return false;
}
public boolean equals(CqlMetadata that) {
if (that == null)
return false;
boolean this_present_name_types = true && this.isSetName_types();
boolean that_present_name_types = true && that.isSetName_types();
if (this_present_name_types || that_present_name_types) {
if (!(this_present_name_types && that_present_name_types))
return false;
if (!this.name_types.equals(that.name_types))
return false;
}
boolean this_present_value_types = true && this.isSetValue_types();
boolean that_present_value_types = true && that.isSetValue_types();
if (this_present_value_types || that_present_value_types) {
if (!(this_present_value_types && that_present_value_types))
return false;
if (!this.value_types.equals(that.value_types))
return false;
}
boolean this_present_default_name_type = true && this.isSetDefault_name_type();
boolean that_present_default_name_type = true && that.isSetDefault_name_type();
if (this_present_default_name_type || that_present_default_name_type) {
if (!(this_present_default_name_type && that_present_default_name_type))
return false;
if (!this.default_name_type.equals(that.default_name_type))
return false;
}
boolean this_present_default_value_type = true && this.isSetDefault_value_type();
boolean that_present_default_value_type = true && that.isSetDefault_value_type();
if (this_present_default_value_type || that_present_default_value_type) {
if (!(this_present_default_value_type && that_present_default_value_type))
return false;
if (!this.default_value_type.equals(that.default_value_type))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy