com.uber.cadence.DomainReplicationConfiguration 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 com.uber.cadence;
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-06-18")
public class DomainReplicationConfiguration 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("DomainReplicationConfiguration");
private static final org.apache.thrift.protocol.TField ACTIVE_CLUSTER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("activeClusterName", org.apache.thrift.protocol.TType.STRING, (short)10);
private static final org.apache.thrift.protocol.TField CLUSTERS_FIELD_DESC = new org.apache.thrift.protocol.TField("clusters", org.apache.thrift.protocol.TType.LIST, (short)20);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new DomainReplicationConfigurationStandardSchemeFactory());
schemes.put(TupleScheme.class, new DomainReplicationConfigurationTupleSchemeFactory());
}
public String activeClusterName; // optional
public List clusters; // 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 {
ACTIVE_CLUSTER_NAME((short)10, "activeClusterName"),
CLUSTERS((short)20, "clusters");
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 10: // ACTIVE_CLUSTER_NAME
return ACTIVE_CLUSTER_NAME;
case 20: // CLUSTERS
return CLUSTERS;
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 _Fields optionals[] = {_Fields.ACTIVE_CLUSTER_NAME,_Fields.CLUSTERS};
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.ACTIVE_CLUSTER_NAME, new org.apache.thrift.meta_data.FieldMetaData("activeClusterName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.CLUSTERS, new org.apache.thrift.meta_data.FieldMetaData("clusters", 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, ClusterReplicationConfiguration.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DomainReplicationConfiguration.class, metaDataMap);
}
public DomainReplicationConfiguration() {
}
/**
* Performs a deep copy on other.
*/
public DomainReplicationConfiguration(DomainReplicationConfiguration other) {
if (other.isSetActiveClusterName()) {
this.activeClusterName = other.activeClusterName;
}
if (other.isSetClusters()) {
List __this__clusters = new ArrayList(other.clusters.size());
for (ClusterReplicationConfiguration other_element : other.clusters) {
__this__clusters.add(new ClusterReplicationConfiguration(other_element));
}
this.clusters = __this__clusters;
}
}
public DomainReplicationConfiguration deepCopy() {
return new DomainReplicationConfiguration(this);
}
@Override
public void clear() {
this.activeClusterName = null;
this.clusters = null;
}
public String getActiveClusterName() {
return this.activeClusterName;
}
public DomainReplicationConfiguration setActiveClusterName(String activeClusterName) {
this.activeClusterName = activeClusterName;
return this;
}
public void unsetActiveClusterName() {
this.activeClusterName = null;
}
/** Returns true if field activeClusterName is set (has been assigned a value) and false otherwise */
public boolean isSetActiveClusterName() {
return this.activeClusterName != null;
}
public void setActiveClusterNameIsSet(boolean value) {
if (!value) {
this.activeClusterName = null;
}
}
public int getClustersSize() {
return (this.clusters == null) ? 0 : this.clusters.size();
}
public java.util.Iterator getClustersIterator() {
return (this.clusters == null) ? null : this.clusters.iterator();
}
public void addToClusters(ClusterReplicationConfiguration elem) {
if (this.clusters == null) {
this.clusters = new ArrayList();
}
this.clusters.add(elem);
}
public List getClusters() {
return this.clusters;
}
public DomainReplicationConfiguration setClusters(List clusters) {
this.clusters = clusters;
return this;
}
public void unsetClusters() {
this.clusters = null;
}
/** Returns true if field clusters is set (has been assigned a value) and false otherwise */
public boolean isSetClusters() {
return this.clusters != null;
}
public void setClustersIsSet(boolean value) {
if (!value) {
this.clusters = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ACTIVE_CLUSTER_NAME:
if (value == null) {
unsetActiveClusterName();
} else {
setActiveClusterName((String)value);
}
break;
case CLUSTERS:
if (value == null) {
unsetClusters();
} else {
setClusters((List)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ACTIVE_CLUSTER_NAME:
return getActiveClusterName();
case CLUSTERS:
return getClusters();
}
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 ACTIVE_CLUSTER_NAME:
return isSetActiveClusterName();
case CLUSTERS:
return isSetClusters();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof DomainReplicationConfiguration)
return this.equals((DomainReplicationConfiguration)that);
return false;
}
public boolean equals(DomainReplicationConfiguration that) {
if (that == null)
return false;
boolean this_present_activeClusterName = true && this.isSetActiveClusterName();
boolean that_present_activeClusterName = true && that.isSetActiveClusterName();
if (this_present_activeClusterName || that_present_activeClusterName) {
if (!(this_present_activeClusterName && that_present_activeClusterName))
return false;
if (!this.activeClusterName.equals(that.activeClusterName))
return false;
}
boolean this_present_clusters = true && this.isSetClusters();
boolean that_present_clusters = true && that.isSetClusters();
if (this_present_clusters || that_present_clusters) {
if (!(this_present_clusters && that_present_clusters))
return false;
if (!this.clusters.equals(that.clusters))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy