| /** |
| * 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.10.0) |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| * @generated |
| */ |
| package org.apache.airavata.model.credential.store; |
| |
| @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) |
| @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") |
| public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser"); |
| |
| private static final org.apache.thrift.protocol.TField GATEWAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayName", org.apache.thrift.protocol.TType.STRING, (short)1); |
| private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2); |
| private static final org.apache.thrift.protocol.TField USER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userEmail", org.apache.thrift.protocol.TType.STRING, (short)3); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CommunityUserStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CommunityUserTupleSchemeFactory(); |
| |
| private java.lang.String gatewayName; // required |
| private java.lang.String username; // required |
| private java.lang.String userEmail; // 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 { |
| GATEWAY_NAME((short)1, "gatewayName"), |
| USERNAME((short)2, "username"), |
| USER_EMAIL((short)3, "userEmail"); |
| |
| private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.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: // GATEWAY_NAME |
| return GATEWAY_NAME; |
| case 2: // USERNAME |
| return USERNAME; |
| case 3: // USER_EMAIL |
| return USER_EMAIL; |
| 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 java.lang.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(java.lang.String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final java.lang.String _fieldName; |
| |
| _Fields(short thriftId, java.lang.String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public java.lang.String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.GATEWAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayName", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CommunityUser.class, metaDataMap); |
| } |
| |
| public CommunityUser() { |
| } |
| |
| public CommunityUser( |
| java.lang.String gatewayName, |
| java.lang.String username, |
| java.lang.String userEmail) |
| { |
| this(); |
| this.gatewayName = gatewayName; |
| this.username = username; |
| this.userEmail = userEmail; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public CommunityUser(CommunityUser other) { |
| if (other.isSetGatewayName()) { |
| this.gatewayName = other.gatewayName; |
| } |
| if (other.isSetUsername()) { |
| this.username = other.username; |
| } |
| if (other.isSetUserEmail()) { |
| this.userEmail = other.userEmail; |
| } |
| } |
| |
| public CommunityUser deepCopy() { |
| return new CommunityUser(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.gatewayName = null; |
| this.username = null; |
| this.userEmail = null; |
| } |
| |
| public java.lang.String getGatewayName() { |
| return this.gatewayName; |
| } |
| |
| public void setGatewayName(java.lang.String gatewayName) { |
| this.gatewayName = gatewayName; |
| } |
| |
| public void unsetGatewayName() { |
| this.gatewayName = null; |
| } |
| |
| /** Returns true if field gatewayName is set (has been assigned a value) and false otherwise */ |
| public boolean isSetGatewayName() { |
| return this.gatewayName != null; |
| } |
| |
| public void setGatewayNameIsSet(boolean value) { |
| if (!value) { |
| this.gatewayName = null; |
| } |
| } |
| |
| public java.lang.String getUsername() { |
| return this.username; |
| } |
| |
| public void setUsername(java.lang.String username) { |
| this.username = username; |
| } |
| |
| public void unsetUsername() { |
| this.username = null; |
| } |
| |
| /** Returns true if field username is set (has been assigned a value) and false otherwise */ |
| public boolean isSetUsername() { |
| return this.username != null; |
| } |
| |
| public void setUsernameIsSet(boolean value) { |
| if (!value) { |
| this.username = null; |
| } |
| } |
| |
| public java.lang.String getUserEmail() { |
| return this.userEmail; |
| } |
| |
| public void setUserEmail(java.lang.String userEmail) { |
| this.userEmail = userEmail; |
| } |
| |
| public void unsetUserEmail() { |
| this.userEmail = null; |
| } |
| |
| /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */ |
| public boolean isSetUserEmail() { |
| return this.userEmail != null; |
| } |
| |
| public void setUserEmailIsSet(boolean value) { |
| if (!value) { |
| this.userEmail = null; |
| } |
| } |
| |
| public void setFieldValue(_Fields field, java.lang.Object value) { |
| switch (field) { |
| case GATEWAY_NAME: |
| if (value == null) { |
| unsetGatewayName(); |
| } else { |
| setGatewayName((java.lang.String)value); |
| } |
| break; |
| |
| case USERNAME: |
| if (value == null) { |
| unsetUsername(); |
| } else { |
| setUsername((java.lang.String)value); |
| } |
| break; |
| |
| case USER_EMAIL: |
| if (value == null) { |
| unsetUserEmail(); |
| } else { |
| setUserEmail((java.lang.String)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public java.lang.Object getFieldValue(_Fields field) { |
| switch (field) { |
| case GATEWAY_NAME: |
| return getGatewayName(); |
| |
| case USERNAME: |
| return getUsername(); |
| |
| case USER_EMAIL: |
| return getUserEmail(); |
| |
| } |
| throw new java.lang.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 java.lang.IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case GATEWAY_NAME: |
| return isSetGatewayName(); |
| case USERNAME: |
| return isSetUsername(); |
| case USER_EMAIL: |
| return isSetUserEmail(); |
| } |
| throw new java.lang.IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(java.lang.Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof CommunityUser) |
| return this.equals((CommunityUser)that); |
| return false; |
| } |
| |
| public boolean equals(CommunityUser that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_gatewayName = true && this.isSetGatewayName(); |
| boolean that_present_gatewayName = true && that.isSetGatewayName(); |
| if (this_present_gatewayName || that_present_gatewayName) { |
| if (!(this_present_gatewayName && that_present_gatewayName)) |
| return false; |
| if (!this.gatewayName.equals(that.gatewayName)) |
| return false; |
| } |
| |
| boolean this_present_username = true && this.isSetUsername(); |
| boolean that_present_username = true && that.isSetUsername(); |
| if (this_present_username || that_present_username) { |
| if (!(this_present_username && that_present_username)) |
| return false; |
| if (!this.username.equals(that.username)) |
| return false; |
| } |
| |
| boolean this_present_userEmail = true && this.isSetUserEmail(); |
| boolean that_present_userEmail = true && that.isSetUserEmail(); |
| if (this_present_userEmail || that_present_userEmail) { |
| if (!(this_present_userEmail && that_present_userEmail)) |
| return false; |
| if (!this.userEmail.equals(that.userEmail)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetGatewayName()) ? 131071 : 524287); |
| if (isSetGatewayName()) |
| hashCode = hashCode * 8191 + gatewayName.hashCode(); |
| |
| hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287); |
| if (isSetUsername()) |
| hashCode = hashCode * 8191 + username.hashCode(); |
| |
| hashCode = hashCode * 8191 + ((isSetUserEmail()) ? 131071 : 524287); |
| if (isSetUserEmail()) |
| hashCode = hashCode * 8191 + userEmail.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(CommunityUser other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = java.lang.Boolean.valueOf(isSetGatewayName()).compareTo(other.isSetGatewayName()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetGatewayName()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayName, other.gatewayName); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetUsername()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = java.lang.Boolean.valueOf(isSetUserEmail()).compareTo(other.isSetUserEmail()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetUserEmail()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, other.userEmail); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public java.lang.String toString() { |
| java.lang.StringBuilder sb = new java.lang.StringBuilder("CommunityUser("); |
| boolean first = true; |
| |
| sb.append("gatewayName:"); |
| if (this.gatewayName == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.gatewayName); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("username:"); |
| if (this.username == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.username); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("userEmail:"); |
| if (this.userEmail == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.userEmail); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| if (!isSetGatewayName()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayName' is unset! Struct:" + toString()); |
| } |
| |
| if (!isSetUsername()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' is unset! Struct:" + toString()); |
| } |
| |
| if (!isSetUserEmail()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'userEmail' is unset! Struct:" + toString()); |
| } |
| |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class CommunityUserStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public CommunityUserStandardScheme getScheme() { |
| return new CommunityUserStandardScheme(); |
| } |
| } |
| |
| private static class CommunityUserStandardScheme extends org.apache.thrift.scheme.StandardScheme<CommunityUser> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, CommunityUser struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // GATEWAY_NAME |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.gatewayName = iprot.readString(); |
| struct.setGatewayNameIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 2: // USERNAME |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.username = iprot.readString(); |
| struct.setUsernameIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 3: // USER_EMAIL |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.userEmail = iprot.readString(); |
| struct.setUserEmailIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, CommunityUser struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.gatewayName != null) { |
| oprot.writeFieldBegin(GATEWAY_NAME_FIELD_DESC); |
| oprot.writeString(struct.gatewayName); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.username != null) { |
| oprot.writeFieldBegin(USERNAME_FIELD_DESC); |
| oprot.writeString(struct.username); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.userEmail != null) { |
| oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC); |
| oprot.writeString(struct.userEmail); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class CommunityUserTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public CommunityUserTupleScheme getScheme() { |
| return new CommunityUserTupleScheme(); |
| } |
| } |
| |
| private static class CommunityUserTupleScheme extends org.apache.thrift.scheme.TupleScheme<CommunityUser> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| oprot.writeString(struct.gatewayName); |
| oprot.writeString(struct.username); |
| oprot.writeString(struct.userEmail); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| struct.gatewayName = iprot.readString(); |
| struct.setGatewayNameIsSet(true); |
| struct.username = iprot.readString(); |
| struct.setUsernameIsSet(true); |
| struct.userEmail = iprot.readString(); |
| struct.setUserEmailIsSet(true); |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |