io.snappydata.thrift.CatalogPartitionObject 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 CatalogPartitionObject 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("CatalogPartitionObject");
private static final org.apache.thrift.protocol.TField SPEC_FIELD_DESC = new org.apache.thrift.protocol.TField("spec", org.apache.thrift.protocol.TType.MAP, (short)1);
private static final org.apache.thrift.protocol.TField STORAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("storage", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)3);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new CatalogPartitionObjectStandardSchemeFactory());
schemes.put(TupleScheme.class, new CatalogPartitionObjectTupleSchemeFactory());
}
public Map spec; // required
public CatalogStorage storage; // required
public Map parameters; // 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 {
SPEC((short)1, "spec"),
STORAGE((short)2, "storage"),
PARAMETERS((short)3, "parameters");
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: // SPEC
return SPEC;
case 2: // STORAGE
return STORAGE;
case 3: // PARAMETERS
return PARAMETERS;
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.SPEC, new org.apache.thrift.meta_data.FieldMetaData("spec", 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),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.STORAGE, new org.apache.thrift.meta_data.FieldMetaData("storage", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CatalogStorage.class)));
tmpMap.put(_Fields.PARAMETERS, new org.apache.thrift.meta_data.FieldMetaData("parameters", 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),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CatalogPartitionObject.class, metaDataMap);
}
public CatalogPartitionObject() {
}
public CatalogPartitionObject(
Map spec,
CatalogStorage storage,
Map parameters)
{
this();
this.spec = spec;
this.storage = storage;
this.parameters = parameters;
}
/**
* Performs a deep copy on other.
*/
public CatalogPartitionObject(CatalogPartitionObject other) {
if (other.isSetSpec()) {
Map __this__spec = new HashMap(other.spec);
this.spec = __this__spec;
}
if (other.isSetStorage()) {
this.storage = new CatalogStorage(other.storage);
}
if (other.isSetParameters()) {
Map __this__parameters = new HashMap(other.parameters);
this.parameters = __this__parameters;
}
}
public CatalogPartitionObject deepCopy() {
return new CatalogPartitionObject(this);
}
@Override
public void clear() {
this.spec = null;
this.storage = null;
this.parameters = null;
}
public int getSpecSize() {
return (this.spec == null) ? 0 : this.spec.size();
}
public void putToSpec(String key, String val) {
if (this.spec == null) {
this.spec = new HashMap();
}
this.spec.put(key, val);
}
public Map getSpec() {
return this.spec;
}
public CatalogPartitionObject setSpec(Map spec) {
this.spec = spec;
return this;
}
public void unsetSpec() {
this.spec = null;
}
/** Returns true if field spec is set (has been assigned a value) and false otherwise */
public boolean isSetSpec() {
return this.spec != null;
}
public void setSpecIsSet(boolean value) {
if (!value) {
this.spec = null;
}
}
public CatalogStorage getStorage() {
return this.storage;
}
public CatalogPartitionObject setStorage(CatalogStorage storage) {
this.storage = storage;
return this;
}
public void unsetStorage() {
this.storage = null;
}
/** Returns true if field storage is set (has been assigned a value) and false otherwise */
public boolean isSetStorage() {
return this.storage != null;
}
public void setStorageIsSet(boolean value) {
if (!value) {
this.storage = null;
}
}
public int getParametersSize() {
return (this.parameters == null) ? 0 : this.parameters.size();
}
public void putToParameters(String key, String val) {
if (this.parameters == null) {
this.parameters = new HashMap();
}
this.parameters.put(key, val);
}
public Map getParameters() {
return this.parameters;
}
public CatalogPartitionObject setParameters(Map parameters) {
this.parameters = parameters;
return this;
}
public void unsetParameters() {
this.parameters = null;
}
/** Returns true if field parameters is set (has been assigned a value) and false otherwise */
public boolean isSetParameters() {
return this.parameters != null;
}
public void setParametersIsSet(boolean value) {
if (!value) {
this.parameters = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SPEC:
if (value == null) {
unsetSpec();
} else {
setSpec((Map)value);
}
break;
case STORAGE:
if (value == null) {
unsetStorage();
} else {
setStorage((CatalogStorage)value);
}
break;
case PARAMETERS:
if (value == null) {
unsetParameters();
} else {
setParameters((Map)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SPEC:
return getSpec();
case STORAGE:
return getStorage();
case PARAMETERS:
return getParameters();
}
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 SPEC:
return isSetSpec();
case STORAGE:
return isSetStorage();
case PARAMETERS:
return isSetParameters();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof CatalogPartitionObject)
return this.equals((CatalogPartitionObject)that);
return false;
}
public boolean equals(CatalogPartitionObject that) {
if (that == null)
return false;
boolean this_present_spec = true && this.isSetSpec();
boolean that_present_spec = true && that.isSetSpec();
if (this_present_spec || that_present_spec) {
if (!(this_present_spec && that_present_spec))
return false;
if (!this.spec.equals(that.spec))
return false;
}
boolean this_present_storage = true && this.isSetStorage();
boolean that_present_storage = true && that.isSetStorage();
if (this_present_storage || that_present_storage) {
if (!(this_present_storage && that_present_storage))
return false;
if (!this.storage.equals(that.storage))
return false;
}
boolean this_present_parameters = true && this.isSetParameters();
boolean that_present_parameters = true && that.isSetParameters();
if (this_present_parameters || that_present_parameters) {
if (!(this_present_parameters && that_present_parameters))
return false;
if (!this.parameters.equals(that.parameters))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy