/** * Autogenerated by Thrift Compiler (0.8.0-dev) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.pyload.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 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 org.slf4j.Logger; import org.slf4j.LoggerFactory; public class AccountInfo implements org.apache.thrift.TBase<AccountInfo, AccountInfo._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AccountInfo"); private static final org.apache.thrift.protocol.TField VALIDUNTIL_FIELD_DESC = new org.apache.thrift.protocol.TField("validuntil", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.MAP, (short)3); private static final org.apache.thrift.protocol.TField VALID_FIELD_DESC = new org.apache.thrift.protocol.TField("valid", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField TRAFFICLEFT_FIELD_DESC = new org.apache.thrift.protocol.TField("trafficleft", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField MAXTRAFFIC_FIELD_DESC = new org.apache.thrift.protocol.TField("maxtraffic", org.apache.thrift.protocol.TType.I64, (short)6); private static final org.apache.thrift.protocol.TField PREMIUM_FIELD_DESC = new org.apache.thrift.protocol.TField("premium", org.apache.thrift.protocol.TType.BOOL, (short)7); private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.STRING, (short)8); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new AccountInfoStandardSchemeFactory()); schemes.put(TupleScheme.class, new AccountInfoTupleSchemeFactory()); } public long validuntil; // required public String login; // required public Map<String,List<String>> options; // required public boolean valid; // required public long trafficleft; // required public long maxtraffic; // required public boolean premium; // required public String 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 { VALIDUNTIL((short)1, "validuntil"), LOGIN((short)2, "login"), OPTIONS((short)3, "options"), VALID((short)4, "valid"), TRAFFICLEFT((short)5, "trafficleft"), MAXTRAFFIC((short)6, "maxtraffic"), PREMIUM((short)7, "premium"), TYPE((short)8, "type"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); 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: // VALIDUNTIL return VALIDUNTIL; case 2: // LOGIN return LOGIN; case 3: // OPTIONS return OPTIONS; case 4: // VALID return VALID; case 5: // TRAFFICLEFT return TRAFFICLEFT; case 6: // MAXTRAFFIC return MAXTRAFFIC; case 7: // PREMIUM return PREMIUM; case 8: // TYPE return 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 private static final int __VALIDUNTIL_ISSET_ID = 0; private static final int __VALID_ISSET_ID = 1; private static final int __TRAFFICLEFT_ISSET_ID = 2; private static final int __MAXTRAFFIC_ISSET_ID = 3; private static final int __PREMIUM_ISSET_ID = 4; private BitSet __isset_bit_vector = new BitSet(5); 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.VALIDUNTIL, new org.apache.thrift.meta_data.FieldMetaData("validuntil", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); tmpMap.put(_Fields.VALID, new org.apache.thrift.meta_data.FieldMetaData("valid", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.TRAFFICLEFT, new org.apache.thrift.meta_data.FieldMetaData("trafficleft", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.MAXTRAFFIC, new org.apache.thrift.meta_data.FieldMetaData("maxtraffic", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.PREMIUM, new org.apache.thrift.meta_data.FieldMetaData("premium", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AccountInfo.class, metaDataMap); } public AccountInfo() { } public AccountInfo( long validuntil, String login, Map<String,List<String>> options, boolean valid, long trafficleft, long maxtraffic, boolean premium, String type) { this(); this.validuntil = validuntil; setValiduntilIsSet(true); this.login = login; this.options = options; this.valid = valid; setValidIsSet(true); this.trafficleft = trafficleft; setTrafficleftIsSet(true); this.maxtraffic = maxtraffic; setMaxtrafficIsSet(true); this.premium = premium; setPremiumIsSet(true); this.type = type; } /** * Performs a deep copy on <i>other</i>. */ public AccountInfo(AccountInfo other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.validuntil = other.validuntil; if (other.isSetLogin()) { this.login = other.login; } if (other.isSetOptions()) { Map<String,List<String>> __this__options = new HashMap<String,List<String>>(); for (Map.Entry<String, List<String>> other_element : other.options.entrySet()) { String other_element_key = other_element.getKey(); List<String> other_element_value = other_element.getValue(); String __this__options_copy_key = other_element_key; List<String> __this__options_copy_value = new ArrayList<String>(); for (String other_element_value_element : other_element_value) { __this__options_copy_value.add(other_element_value_element); } __this__options.put(__this__options_copy_key, __this__options_copy_value); } this.options = __this__options; } this.valid = other.valid; this.trafficleft = other.trafficleft; this.maxtraffic = other.maxtraffic; this.premium = other.premium; if (other.isSetType()) { this.type = other.type; } } public AccountInfo deepCopy() { return new AccountInfo(this); } @Override public void clear() { setValiduntilIsSet(false); this.validuntil = 0; this.login = null; this.options = null; setValidIsSet(false); this.valid = false; setTrafficleftIsSet(false); this.trafficleft = 0; setMaxtrafficIsSet(false); this.maxtraffic = 0; setPremiumIsSet(false); this.premium = false; this.type = null; } public long getValiduntil() { return this.validuntil; } public AccountInfo setValiduntil(long validuntil) { this.validuntil = validuntil; setValiduntilIsSet(true); return this; } public void unsetValiduntil() { __isset_bit_vector.clear(__VALIDUNTIL_ISSET_ID); } /** Returns true if field validuntil is set (has been assigned a value) and false otherwise */ public boolean isSetValiduntil() { return __isset_bit_vector.get(__VALIDUNTIL_ISSET_ID); } public void setValiduntilIsSet(boolean value) { __isset_bit_vector.set(__VALIDUNTIL_ISSET_ID, value); } public String getLogin() { return this.login; } public AccountInfo setLogin(String login) { this.login = login; return this; } public void unsetLogin() { this.login = null; } /** Returns true if field login is set (has been assigned a value) and false otherwise */ public boolean isSetLogin() { return this.login != null; } public void setLoginIsSet(boolean value) { if (!value) { this.login = null; } } public int getOptionsSize() { return (this.options == null) ? 0 : this.options.size(); } public void putToOptions(String key, List<String> val) { if (this.options == null) { this.options = new HashMap<String,List<String>>(); } this.options.put(key, val); } public Map<String,List<String>> getOptions() { return this.options; } public AccountInfo setOptions(Map<String,List<String>> options) { this.options = options; return this; } public void unsetOptions() { this.options = null; } /** Returns true if field options is set (has been assigned a value) and false otherwise */ public boolean isSetOptions() { return this.options != null; } public void setOptionsIsSet(boolean value) { if (!value) { this.options = null; } } public boolean isValid() { return this.valid; } public AccountInfo setValid(boolean valid) { this.valid = valid; setValidIsSet(true); return this; } public void unsetValid() { __isset_bit_vector.clear(__VALID_ISSET_ID); } /** Returns true if field valid is set (has been assigned a value) and false otherwise */ public boolean isSetValid() { return __isset_bit_vector.get(__VALID_ISSET_ID); } public void setValidIsSet(boolean value) { __isset_bit_vector.set(__VALID_ISSET_ID, value); } public long getTrafficleft() { return this.trafficleft; } public AccountInfo setTrafficleft(long trafficleft) { this.trafficleft = trafficleft; setTrafficleftIsSet(true); return this; } public void unsetTrafficleft() { __isset_bit_vector.clear(__TRAFFICLEFT_ISSET_ID); } /** Returns true if field trafficleft is set (has been assigned a value) and false otherwise */ public boolean isSetTrafficleft() { return __isset_bit_vector.get(__TRAFFICLEFT_ISSET_ID); } public void setTrafficleftIsSet(boolean value) { __isset_bit_vector.set(__TRAFFICLEFT_ISSET_ID, value); } public long getMaxtraffic() { return this.maxtraffic; } public AccountInfo setMaxtraffic(long maxtraffic) { this.maxtraffic = maxtraffic; setMaxtrafficIsSet(true); return this; } public void unsetMaxtraffic() { __isset_bit_vector.clear(__MAXTRAFFIC_ISSET_ID); } /** Returns true if field maxtraffic is set (has been assigned a value) and false otherwise */ public boolean isSetMaxtraffic() { return __isset_bit_vector.get(__MAXTRAFFIC_ISSET_ID); } public void setMaxtrafficIsSet(boolean value) { __isset_bit_vector.set(__MAXTRAFFIC_ISSET_ID, value); } public boolean isPremium() { return this.premium; } public AccountInfo setPremium(boolean premium) { this.premium = premium; setPremiumIsSet(true); return this; } public void unsetPremium() { __isset_bit_vector.clear(__PREMIUM_ISSET_ID); } /** Returns true if field premium is set (has been assigned a value) and false otherwise */ public boolean isSetPremium() { return __isset_bit_vector.get(__PREMIUM_ISSET_ID); } public void setPremiumIsSet(boolean value) { __isset_bit_vector.set(__PREMIUM_ISSET_ID, value); } public String getType() { return this.type; } public AccountInfo setType(String type) { this.type = type; return this; } public void unsetType() { this.type = null; } /** Returns true if field type is set (has been assigned a value) and false otherwise */ public boolean isSetType() { return this.type != null; } public void setTypeIsSet(boolean value) { if (!value) { this.type = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case VALIDUNTIL: if (value == null) { unsetValiduntil(); } else { setValiduntil((Long)value); } break; case LOGIN: if (value == null) { unsetLogin(); } else { setLogin((String)value); } break; case OPTIONS: if (value == null) { unsetOptions(); } else { setOptions((Map<String,List<String>>)value); } break; case VALID: if (value == null) { unsetValid(); } else { setValid((Boolean)value); } break; case TRAFFICLEFT: if (value == null) { unsetTrafficleft(); } else { setTrafficleft((Long)value); } break; case MAXTRAFFIC: if (value == null) { unsetMaxtraffic(); } else { setMaxtraffic((Long)value); } break; case PREMIUM: if (value == null) { unsetPremium(); } else { setPremium((Boolean)value); } break; case TYPE: if (value == null) { unsetType(); } else { setType((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case VALIDUNTIL: return Long.valueOf(getValiduntil()); case LOGIN: return getLogin(); case OPTIONS: return getOptions(); case VALID: return Boolean.valueOf(isValid()); case TRAFFICLEFT: return Long.valueOf(getTrafficleft()); case MAXTRAFFIC: return Long.valueOf(getMaxtraffic()); case PREMIUM: return Boolean.valueOf(isPremium()); case TYPE: return getType(); } 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 VALIDUNTIL: return isSetValiduntil(); case LOGIN: return isSetLogin(); case OPTIONS: return isSetOptions(); case VALID: return isSetValid(); case TRAFFICLEFT: return isSetTrafficleft(); case MAXTRAFFIC: return isSetMaxtraffic(); case PREMIUM: return isSetPremium(); case TYPE: return isSetType(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof AccountInfo) return this.equals((AccountInfo)that); return false; } public boolean equals(AccountInfo that) { if (that == null) return false; boolean this_present_validuntil = true; boolean that_present_validuntil = true; if (this_present_validuntil || that_present_validuntil) { if (!(this_present_validuntil && that_present_validuntil)) return false; if (this.validuntil != that.validuntil) return false; } boolean this_present_login = true && this.isSetLogin(); boolean that_present_login = true && that.isSetLogin(); if (this_present_login || that_present_login) { if (!(this_present_login && that_present_login)) return false; if (!this.login.equals(that.login)) return false; } boolean this_present_options = true && this.isSetOptions(); boolean that_present_options = true && that.isSetOptions(); if (this_present_options || that_present_options) { if (!(this_present_options && that_present_options)) return false; if (!this.options.equals(that.options)) return false; } boolean this_present_valid = true; boolean that_present_valid = true; if (this_present_valid || that_present_valid) { if (!(this_present_valid && that_present_valid)) return false; if (this.valid != that.valid) return false; } boolean this_present_trafficleft = true; boolean that_present_trafficleft = true; if (this_present_trafficleft || that_present_trafficleft) { if (!(this_present_trafficleft && that_present_trafficleft)) return false; if (this.trafficleft != that.trafficleft) return false; } boolean this_present_maxtraffic = true; boolean that_present_maxtraffic = true; if (this_present_maxtraffic || that_present_maxtraffic) { if (!(this_present_maxtraffic && that_present_maxtraffic)) return false; if (this.maxtraffic != that.maxtraffic) return false; } boolean this_present_premium = true; boolean that_present_premium = true; if (this_present_premium || that_present_premium) { if (!(this_present_premium && that_present_premium)) return false; if (this.premium != that.premium) return false; } boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(AccountInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; AccountInfo typedOther = (AccountInfo)other; lastComparison = Boolean.valueOf(isSetValiduntil()).compareTo(typedOther.isSetValiduntil()); if (lastComparison != 0) { return lastComparison; } if (isSetValiduntil()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validuntil, typedOther.validuntil); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLogin()).compareTo(typedOther.isSetLogin()); if (lastComparison != 0) { return lastComparison; } if (isSetLogin()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login, typedOther.login); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetOptions()).compareTo(typedOther.isSetOptions()); if (lastComparison != 0) { return lastComparison; } if (isSetOptions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, typedOther.options); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetValid()).compareTo(typedOther.isSetValid()); if (lastComparison != 0) { return lastComparison; } if (isSetValid()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valid, typedOther.valid); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTrafficleft()).compareTo(typedOther.isSetTrafficleft()); if (lastComparison != 0) { return lastComparison; } if (isSetTrafficleft()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.trafficleft, typedOther.trafficleft); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMaxtraffic()).compareTo(typedOther.isSetMaxtraffic()); if (lastComparison != 0) { return lastComparison; } if (isSetMaxtraffic()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxtraffic, typedOther.maxtraffic); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPremium()).compareTo(typedOther.isSetPremium()); if (lastComparison != 0) { return lastComparison; } if (isSetPremium()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.premium, typedOther.premium); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType()); if (lastComparison != 0) { return lastComparison; } if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type); 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 { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("AccountInfo("); boolean first = true; sb.append("validuntil:"); sb.append(this.validuntil); first = false; if (!first) sb.append(", "); sb.append("login:"); if (this.login == null) { sb.append("null"); } else { sb.append(this.login); } first = false; if (!first) sb.append(", "); sb.append("options:"); if (this.options == null) { sb.append("null"); } else { sb.append(this.options); } first = false; if (!first) sb.append(", "); sb.append("valid:"); sb.append(this.valid); first = false; if (!first) sb.append(", "); sb.append("trafficleft:"); sb.append(this.trafficleft); first = false; if (!first) sb.append(", "); sb.append("maxtraffic:"); sb.append(this.maxtraffic); first = false; if (!first) sb.append(", "); sb.append("premium:"); sb.append(this.premium); first = false; if (!first) sb.append(", "); sb.append("type:"); if (this.type == null) { sb.append("null"); } else { sb.append(this.type); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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.getMessage()); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bit_vector = new BitSet(1); 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.getMessage()); } } private static class AccountInfoStandardSchemeFactory implements SchemeFactory { public AccountInfoStandardScheme getScheme() { return new AccountInfoStandardScheme(); } } private static class AccountInfoStandardScheme extends StandardScheme<AccountInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, AccountInfo 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: // VALIDUNTIL if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.validuntil = iprot.readI64(); struct.setValiduntilIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // LOGIN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.login = iprot.readString(); struct.setLoginIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // OPTIONS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map24 = iprot.readMapBegin(); struct.options = new HashMap<String,List<String>>(2*_map24.size); for (int _i25 = 0; _i25 < _map24.size; ++_i25) { String _key26; // required List<String> _val27; // required _key26 = iprot.readString(); { org.apache.thrift.protocol.TList _list28 = iprot.readListBegin(); _val27 = new ArrayList<String>(_list28.size); for (int _i29 = 0; _i29 < _list28.size; ++_i29) { String _elem30; // required _elem30 = iprot.readString(); _val27.add(_elem30); } iprot.readListEnd(); } struct.options.put(_key26, _val27); } iprot.readMapEnd(); } struct.setOptionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // VALID if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.valid = iprot.readBool(); struct.setValidIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // TRAFFICLEFT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.trafficleft = iprot.readI64(); struct.setTrafficleftIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // MAXTRAFFIC if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.maxtraffic = iprot.readI64(); struct.setMaxtrafficIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // PREMIUM if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.premium = iprot.readBool(); struct.setPremiumIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.type = iprot.readString(); struct.setTypeIsSet(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(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, AccountInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(VALIDUNTIL_FIELD_DESC); oprot.writeI64(struct.validuntil); oprot.writeFieldEnd(); if (struct.login != null) { oprot.writeFieldBegin(LOGIN_FIELD_DESC); oprot.writeString(struct.login); oprot.writeFieldEnd(); } if (struct.options != null) { oprot.writeFieldBegin(OPTIONS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.options.size())); for (Map.Entry<String, List<String>> _iter31 : struct.options.entrySet()) { oprot.writeString(_iter31.getKey()); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter31.getValue().size())); for (String _iter32 : _iter31.getValue()) { oprot.writeString(_iter32); } oprot.writeListEnd(); } } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(VALID_FIELD_DESC); oprot.writeBool(struct.valid); oprot.writeFieldEnd(); oprot.writeFieldBegin(TRAFFICLEFT_FIELD_DESC); oprot.writeI64(struct.trafficleft); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAXTRAFFIC_FIELD_DESC); oprot.writeI64(struct.maxtraffic); oprot.writeFieldEnd(); oprot.writeFieldBegin(PREMIUM_FIELD_DESC); oprot.writeBool(struct.premium); oprot.writeFieldEnd(); if (struct.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeString(struct.type); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class AccountInfoTupleSchemeFactory implements SchemeFactory { public AccountInfoTupleScheme getScheme() { return new AccountInfoTupleScheme(); } } private static class AccountInfoTupleScheme extends TupleScheme<AccountInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, AccountInfo struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetValiduntil()) { optionals.set(0); } if (struct.isSetLogin()) { optionals.set(1); } if (struct.isSetOptions()) { optionals.set(2); } if (struct.isSetValid()) { optionals.set(3); } if (struct.isSetTrafficleft()) { optionals.set(4); } if (struct.isSetMaxtraffic()) { optionals.set(5); } if (struct.isSetPremium()) { optionals.set(6); } if (struct.isSetType()) { optionals.set(7); } oprot.writeBitSet(optionals, 8); if (struct.isSetValiduntil()) { oprot.writeI64(struct.validuntil); } if (struct.isSetLogin()) { oprot.writeString(struct.login); } if (struct.isSetOptions()) { { oprot.writeI32(struct.options.size()); for (Map.Entry<String, List<String>> _iter33 : struct.options.entrySet()) { oprot.writeString(_iter33.getKey()); { oprot.writeI32(_iter33.getValue().size()); for (String _iter34 : _iter33.getValue()) { oprot.writeString(_iter34); } } } } } if (struct.isSetValid()) { oprot.writeBool(struct.valid); } if (struct.isSetTrafficleft()) { oprot.writeI64(struct.trafficleft); } if (struct.isSetMaxtraffic()) { oprot.writeI64(struct.maxtraffic); } if (struct.isSetPremium()) { oprot.writeBool(struct.premium); } if (struct.isSetType()) { oprot.writeString(struct.type); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, AccountInfo struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.validuntil = iprot.readI64(); struct.setValiduntilIsSet(true); } if (incoming.get(1)) { struct.login = iprot.readString(); struct.setLoginIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TMap _map35 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); struct.options = new HashMap<String,List<String>>(2*_map35.size); for (int _i36 = 0; _i36 < _map35.size; ++_i36) { String _key37; // required List<String> _val38; // required _key37 = iprot.readString(); { org.apache.thrift.protocol.TList _list39 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); _val38 = new ArrayList<String>(_list39.size); for (int _i40 = 0; _i40 < _list39.size; ++_i40) { String _elem41; // required _elem41 = iprot.readString(); _val38.add(_elem41); } } struct.options.put(_key37, _val38); } } struct.setOptionsIsSet(true); } if (incoming.get(3)) { struct.valid = iprot.readBool(); struct.setValidIsSet(true); } if (incoming.get(4)) { struct.trafficleft = iprot.readI64(); struct.setTrafficleftIsSet(true); } if (incoming.get(5)) { struct.maxtraffic = iprot.readI64(); struct.setMaxtrafficIsSet(true); } if (incoming.get(6)) { struct.premium = iprot.readBool(); struct.setPremiumIsSet(true); } if (incoming.get(7)) { struct.type = iprot.readString(); struct.setTypeIsSet(true); } } } }