org.apache.airavata.model.user.NSFDemographics Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.model.user;
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"})
/**
* A structure holding the NSF Demographic information.
*
*
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-07-13")
public class NSFDemographics 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("NSFDemographics");
private static final org.apache.thrift.protocol.TField GENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("gender", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField US_CITIZENSHIP_FIELD_DESC = new org.apache.thrift.protocol.TField("usCitizenship", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField ETHNICITIES_FIELD_DESC = new org.apache.thrift.protocol.TField("ethnicities", org.apache.thrift.protocol.TType.LIST, (short)3);
private static final org.apache.thrift.protocol.TField RACES_FIELD_DESC = new org.apache.thrift.protocol.TField("races", org.apache.thrift.protocol.TType.LIST, (short)4);
private static final org.apache.thrift.protocol.TField DISABILITIES_FIELD_DESC = new org.apache.thrift.protocol.TField("disabilities", org.apache.thrift.protocol.TType.LIST, (short)5);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new NSFDemographicsStandardSchemeFactory());
schemes.put(TupleScheme.class, new NSFDemographicsTupleSchemeFactory());
}
private String gender; // optional
private USCitizenship usCitizenship; // optional
private List ethnicities; // optional
private List races; // optional
private List disabilities; // 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 {
GENDER((short)1, "gender"),
/**
*
* @see USCitizenship
*/
US_CITIZENSHIP((short)2, "usCitizenship"),
ETHNICITIES((short)3, "ethnicities"),
RACES((short)4, "races"),
DISABILITIES((short)5, "disabilities");
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: // GENDER
return GENDER;
case 2: // US_CITIZENSHIP
return US_CITIZENSHIP;
case 3: // ETHNICITIES
return ETHNICITIES;
case 4: // RACES
return RACES;
case 5: // DISABILITIES
return DISABILITIES;
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.GENDER,_Fields.US_CITIZENSHIP,_Fields.ETHNICITIES,_Fields.RACES,_Fields.DISABILITIES};
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.GENDER, new org.apache.thrift.meta_data.FieldMetaData("gender", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.US_CITIZENSHIP, new org.apache.thrift.meta_data.FieldMetaData("usCitizenship", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, USCitizenship.class)));
tmpMap.put(_Fields.ETHNICITIES, new org.apache.thrift.meta_data.FieldMetaData("ethnicities", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ethnicity.class))));
tmpMap.put(_Fields.RACES, new org.apache.thrift.meta_data.FieldMetaData("races", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, race.class))));
tmpMap.put(_Fields.DISABILITIES, new org.apache.thrift.meta_data.FieldMetaData("disabilities", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, disability.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NSFDemographics.class, metaDataMap);
}
public NSFDemographics() {
}
/**
* Performs a deep copy on other.
*/
public NSFDemographics(NSFDemographics other) {
if (other.isSetGender()) {
this.gender = other.gender;
}
if (other.isSetUsCitizenship()) {
this.usCitizenship = other.usCitizenship;
}
if (other.isSetEthnicities()) {
List __this__ethnicities = new ArrayList(other.ethnicities.size());
for (ethnicity other_element : other.ethnicities) {
__this__ethnicities.add(other_element);
}
this.ethnicities = __this__ethnicities;
}
if (other.isSetRaces()) {
List __this__races = new ArrayList(other.races.size());
for (race other_element : other.races) {
__this__races.add(other_element);
}
this.races = __this__races;
}
if (other.isSetDisabilities()) {
List __this__disabilities = new ArrayList(other.disabilities.size());
for (disability other_element : other.disabilities) {
__this__disabilities.add(other_element);
}
this.disabilities = __this__disabilities;
}
}
public NSFDemographics deepCopy() {
return new NSFDemographics(this);
}
@Override
public void clear() {
this.gender = null;
this.usCitizenship = null;
this.ethnicities = null;
this.races = null;
this.disabilities = null;
}
public String getGender() {
return this.gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public void unsetGender() {
this.gender = null;
}
/** Returns true if field gender is set (has been assigned a value) and false otherwise */
public boolean isSetGender() {
return this.gender != null;
}
public void setGenderIsSet(boolean value) {
if (!value) {
this.gender = null;
}
}
/**
*
* @see USCitizenship
*/
public USCitizenship getUsCitizenship() {
return this.usCitizenship;
}
/**
*
* @see USCitizenship
*/
public void setUsCitizenship(USCitizenship usCitizenship) {
this.usCitizenship = usCitizenship;
}
public void unsetUsCitizenship() {
this.usCitizenship = null;
}
/** Returns true if field usCitizenship is set (has been assigned a value) and false otherwise */
public boolean isSetUsCitizenship() {
return this.usCitizenship != null;
}
public void setUsCitizenshipIsSet(boolean value) {
if (!value) {
this.usCitizenship = null;
}
}
public int getEthnicitiesSize() {
return (this.ethnicities == null) ? 0 : this.ethnicities.size();
}
public java.util.Iterator getEthnicitiesIterator() {
return (this.ethnicities == null) ? null : this.ethnicities.iterator();
}
public void addToEthnicities(ethnicity elem) {
if (this.ethnicities == null) {
this.ethnicities = new ArrayList();
}
this.ethnicities.add(elem);
}
public List getEthnicities() {
return this.ethnicities;
}
public void setEthnicities(List ethnicities) {
this.ethnicities = ethnicities;
}
public void unsetEthnicities() {
this.ethnicities = null;
}
/** Returns true if field ethnicities is set (has been assigned a value) and false otherwise */
public boolean isSetEthnicities() {
return this.ethnicities != null;
}
public void setEthnicitiesIsSet(boolean value) {
if (!value) {
this.ethnicities = null;
}
}
public int getRacesSize() {
return (this.races == null) ? 0 : this.races.size();
}
public java.util.Iterator getRacesIterator() {
return (this.races == null) ? null : this.races.iterator();
}
public void addToRaces(race elem) {
if (this.races == null) {
this.races = new ArrayList();
}
this.races.add(elem);
}
public List getRaces() {
return this.races;
}
public void setRaces(List races) {
this.races = races;
}
public void unsetRaces() {
this.races = null;
}
/** Returns true if field races is set (has been assigned a value) and false otherwise */
public boolean isSetRaces() {
return this.races != null;
}
public void setRacesIsSet(boolean value) {
if (!value) {
this.races = null;
}
}
public int getDisabilitiesSize() {
return (this.disabilities == null) ? 0 : this.disabilities.size();
}
public java.util.Iterator getDisabilitiesIterator() {
return (this.disabilities == null) ? null : this.disabilities.iterator();
}
public void addToDisabilities(disability elem) {
if (this.disabilities == null) {
this.disabilities = new ArrayList();
}
this.disabilities.add(elem);
}
public List getDisabilities() {
return this.disabilities;
}
public void setDisabilities(List disabilities) {
this.disabilities = disabilities;
}
public void unsetDisabilities() {
this.disabilities = null;
}
/** Returns true if field disabilities is set (has been assigned a value) and false otherwise */
public boolean isSetDisabilities() {
return this.disabilities != null;
}
public void setDisabilitiesIsSet(boolean value) {
if (!value) {
this.disabilities = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GENDER:
if (value == null) {
unsetGender();
} else {
setGender((String)value);
}
break;
case US_CITIZENSHIP:
if (value == null) {
unsetUsCitizenship();
} else {
setUsCitizenship((USCitizenship)value);
}
break;
case ETHNICITIES:
if (value == null) {
unsetEthnicities();
} else {
setEthnicities((List)value);
}
break;
case RACES:
if (value == null) {
unsetRaces();
} else {
setRaces((List)value);
}
break;
case DISABILITIES:
if (value == null) {
unsetDisabilities();
} else {
setDisabilities((List)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GENDER:
return getGender();
case US_CITIZENSHIP:
return getUsCitizenship();
case ETHNICITIES:
return getEthnicities();
case RACES:
return getRaces();
case DISABILITIES:
return getDisabilities();
}
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 GENDER:
return isSetGender();
case US_CITIZENSHIP:
return isSetUsCitizenship();
case ETHNICITIES:
return isSetEthnicities();
case RACES:
return isSetRaces();
case DISABILITIES:
return isSetDisabilities();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof NSFDemographics)
return this.equals((NSFDemographics)that);
return false;
}
public boolean equals(NSFDemographics that) {
if (that == null)
return false;
boolean this_present_gender = true && this.isSetGender();
boolean that_present_gender = true && that.isSetGender();
if (this_present_gender || that_present_gender) {
if (!(this_present_gender && that_present_gender))
return false;
if (!this.gender.equals(that.gender))
return false;
}
boolean this_present_usCitizenship = true && this.isSetUsCitizenship();
boolean that_present_usCitizenship = true && that.isSetUsCitizenship();
if (this_present_usCitizenship || that_present_usCitizenship) {
if (!(this_present_usCitizenship && that_present_usCitizenship))
return false;
if (!this.usCitizenship.equals(that.usCitizenship))
return false;
}
boolean this_present_ethnicities = true && this.isSetEthnicities();
boolean that_present_ethnicities = true && that.isSetEthnicities();
if (this_present_ethnicities || that_present_ethnicities) {
if (!(this_present_ethnicities && that_present_ethnicities))
return false;
if (!this.ethnicities.equals(that.ethnicities))
return false;
}
boolean this_present_races = true && this.isSetRaces();
boolean that_present_races = true && that.isSetRaces();
if (this_present_races || that_present_races) {
if (!(this_present_races && that_present_races))
return false;
if (!this.races.equals(that.races))
return false;
}
boolean this_present_disabilities = true && this.isSetDisabilities();
boolean that_present_disabilities = true && that.isSetDisabilities();
if (this_present_disabilities || that_present_disabilities) {
if (!(this_present_disabilities && that_present_disabilities))
return false;
if (!this.disabilities.equals(that.disabilities))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy