/**
 * Autogenerated by Thrift Compiler (0.17.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.tim.packet;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.17.0)", date = "2023-02-11")
public class TimRoster implements org.apache.thrift.TBase<TimRoster, TimRoster._Fields>, java.io.Serializable, Cloneable, Comparable<TimRoster> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TimRoster");

  private static final org.apache.thrift.protocol.TField SUBSCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("subscription", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField TID_FIELD_DESC = new org.apache.thrift.protocol.TField("tid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField EXTRA_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("extraMap", org.apache.thrift.protocol.TType.MAP, (short)4);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TimRosterStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TimRosterTupleSchemeFactory();

  /**
   * none表示用户和contact之前没有任何的关系（虽然在server的buddy list中存在）
   * to表示用户能看到contact的presence，但是contact看不到用户的Presence
   * from和to的含义相反，指用户看不到contact的presence，但是contact可以看到
   * both表示相关之间都能看到对方的presence
   */
  public @org.apache.thrift.annotation.Nullable java.lang.String subscription; // required
  public @org.apache.thrift.annotation.Nullable Tid tid; // required
  /**
   * 用户名
   */
  public @org.apache.thrift.annotation.Nullable java.lang.String name; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> extraMap; // 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 {
    /**
     * none表示用户和contact之前没有任何的关系（虽然在server的buddy list中存在）
     * to表示用户能看到contact的presence，但是contact看不到用户的Presence
     * from和to的含义相反，指用户看不到contact的presence，但是contact可以看到
     * both表示相关之间都能看到对方的presence
     */
    SUBSCRIPTION((short)1, "subscription"),
    TID((short)2, "tid"),
    /**
     * 用户名
     */
    NAME((short)3, "name"),
    EXTRA_MAP((short)4, "extraMap");

    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.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // SUBSCRIPTION
          return SUBSCRIPTION;
        case 2: // TID
          return TID;
        case 3: // NAME
          return NAME;
        case 4: // EXTRA_MAP
          return EXTRA_MAP;
        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.
     */
    @org.apache.thrift.annotation.Nullable
    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;
    }

    @Override
    public short getThriftFieldId() {
      return _thriftId;
    }

    @Override
    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final _Fields optionals[] = {_Fields.NAME,_Fields.EXTRA_MAP};
  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.SUBSCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("subscription", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TID, new org.apache.thrift.meta_data.FieldMetaData("tid", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Tid.class)));
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.EXTRA_MAP, new org.apache.thrift.meta_data.FieldMetaData("extraMap", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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 = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TimRoster.class, metaDataMap);
  }

  public TimRoster() {
  }

  public TimRoster(
    java.lang.String subscription,
    Tid tid)
  {
    this();
    this.subscription = subscription;
    this.tid = tid;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TimRoster(TimRoster other) {
    if (other.isSetSubscription()) {
      this.subscription = other.subscription;
    }
    if (other.isSetTid()) {
      this.tid = new Tid(other.tid);
    }
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetExtraMap()) {
      java.util.Map<java.lang.String,java.lang.String> __this__extraMap = new java.util.HashMap<java.lang.String,java.lang.String>(other.extraMap);
      this.extraMap = __this__extraMap;
    }
  }

  @Override
  public TimRoster deepCopy() {
    return new TimRoster(this);
  }

  @Override
  public void clear() {
    this.subscription = null;
    this.tid = null;
    this.name = null;
    this.extraMap = null;
  }

  /**
   * none表示用户和contact之前没有任何的关系（虽然在server的buddy list中存在）
   * to表示用户能看到contact的presence，但是contact看不到用户的Presence
   * from和to的含义相反，指用户看不到contact的presence，但是contact可以看到
   * both表示相关之间都能看到对方的presence
   */
  @org.apache.thrift.annotation.Nullable
  public java.lang.String getSubscription() {
    return this.subscription;
  }

  /**
   * none表示用户和contact之前没有任何的关系（虽然在server的buddy list中存在）
   * to表示用户能看到contact的presence，但是contact看不到用户的Presence
   * from和to的含义相反，指用户看不到contact的presence，但是contact可以看到
   * both表示相关之间都能看到对方的presence
   */
  public TimRoster setSubscription(@org.apache.thrift.annotation.Nullable java.lang.String subscription) {
    this.subscription = subscription;
    return this;
  }

  public void unsetSubscription() {
    this.subscription = null;
  }

  /** Returns true if field subscription is set (has been assigned a value) and false otherwise */
  public boolean isSetSubscription() {
    return this.subscription != null;
  }

  public void setSubscriptionIsSet(boolean value) {
    if (!value) {
      this.subscription = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public Tid getTid() {
    return this.tid;
  }

  public TimRoster setTid(@org.apache.thrift.annotation.Nullable Tid tid) {
    this.tid = tid;
    return this;
  }

  public void unsetTid() {
    this.tid = null;
  }

  /** Returns true if field tid is set (has been assigned a value) and false otherwise */
  public boolean isSetTid() {
    return this.tid != null;
  }

  public void setTidIsSet(boolean value) {
    if (!value) {
      this.tid = null;
    }
  }

  /**
   * 用户名
   */
  @org.apache.thrift.annotation.Nullable
  public java.lang.String getName() {
    return this.name;
  }

  /**
   * 用户名
   */
  public TimRoster setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
    this.name = name;
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

  /** Returns true if field name is set (has been assigned a value) and false otherwise */
  public boolean isSetName() {
    return this.name != null;
  }

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

  public int getExtraMapSize() {
    return (this.extraMap == null) ? 0 : this.extraMap.size();
  }

  public void putToExtraMap(java.lang.String key, java.lang.String val) {
    if (this.extraMap == null) {
      this.extraMap = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.extraMap.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.String> getExtraMap() {
    return this.extraMap;
  }

  public TimRoster setExtraMap(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> extraMap) {
    this.extraMap = extraMap;
    return this;
  }

  public void unsetExtraMap() {
    this.extraMap = null;
  }

  /** Returns true if field extraMap is set (has been assigned a value) and false otherwise */
  public boolean isSetExtraMap() {
    return this.extraMap != null;
  }

  public void setExtraMapIsSet(boolean value) {
    if (!value) {
      this.extraMap = null;
    }
  }

  @Override
  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case SUBSCRIPTION:
      if (value == null) {
        unsetSubscription();
      } else {
        setSubscription((java.lang.String)value);
      }
      break;

    case TID:
      if (value == null) {
        unsetTid();
      } else {
        setTid((Tid)value);
      }
      break;

    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((java.lang.String)value);
      }
      break;

    case EXTRA_MAP:
      if (value == null) {
        unsetExtraMap();
      } else {
        setExtraMap((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  @Override
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case SUBSCRIPTION:
      return getSubscription();

    case TID:
      return getTid();

    case NAME:
      return getName();

    case EXTRA_MAP:
      return getExtraMap();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  @Override
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case SUBSCRIPTION:
      return isSetSubscription();
    case TID:
      return isSetTid();
    case NAME:
      return isSetName();
    case EXTRA_MAP:
      return isSetExtraMap();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TimRoster)
      return this.equals((TimRoster)that);
    return false;
  }

  public boolean equals(TimRoster that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_subscription = true && this.isSetSubscription();
    boolean that_present_subscription = true && that.isSetSubscription();
    if (this_present_subscription || that_present_subscription) {
      if (!(this_present_subscription && that_present_subscription))
        return false;
      if (!this.subscription.equals(that.subscription))
        return false;
    }

    boolean this_present_tid = true && this.isSetTid();
    boolean that_present_tid = true && that.isSetTid();
    if (this_present_tid || that_present_tid) {
      if (!(this_present_tid && that_present_tid))
        return false;
      if (!this.tid.equals(that.tid))
        return false;
    }

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_extraMap = true && this.isSetExtraMap();
    boolean that_present_extraMap = true && that.isSetExtraMap();
    if (this_present_extraMap || that_present_extraMap) {
      if (!(this_present_extraMap && that_present_extraMap))
        return false;
      if (!this.extraMap.equals(that.extraMap))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetSubscription()) ? 131071 : 524287);
    if (isSetSubscription())
      hashCode = hashCode * 8191 + subscription.hashCode();

    hashCode = hashCode * 8191 + ((isSetTid()) ? 131071 : 524287);
    if (isSetTid())
      hashCode = hashCode * 8191 + tid.hashCode();

    hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
    if (isSetName())
      hashCode = hashCode * 8191 + name.hashCode();

    hashCode = hashCode * 8191 + ((isSetExtraMap()) ? 131071 : 524287);
    if (isSetExtraMap())
      hashCode = hashCode * 8191 + extraMap.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(TimRoster other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetSubscription(), other.isSetSubscription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSubscription()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subscription, other.subscription);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTid(), other.isSetTid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tid, other.tid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetExtraMap(), other.isSetExtraMap());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExtraMap()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraMap, other.extraMap);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  @Override
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  @Override
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  @Override
  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("TimRoster(");
    boolean first = true;

    sb.append("subscription:");
    if (this.subscription == null) {
      sb.append("null");
    } else {
      sb.append(this.subscription);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("tid:");
    if (this.tid == null) {
      sb.append("null");
    } else {
      sb.append(this.tid);
    }
    first = false;
    if (isSetName()) {
      if (!first) sb.append(", ");
      sb.append("name:");
      if (this.name == null) {
        sb.append("null");
      } else {
        sb.append(this.name);
      }
      first = false;
    }
    if (isSetExtraMap()) {
      if (!first) sb.append(", ");
      sb.append("extraMap:");
      if (this.extraMap == null) {
        sb.append("null");
      } else {
        sb.append(this.extraMap);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (subscription == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'subscription' was not present! Struct: " + toString());
    }
    if (tid == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'tid' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
    if (tid != null) {
      tid.validate();
    }
  }

  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 TimRosterStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TimRosterStandardScheme getScheme() {
      return new TimRosterStandardScheme();
    }
  }

  private static class TimRosterStandardScheme extends org.apache.thrift.scheme.StandardScheme<TimRoster> {

    @Override
    public void read(org.apache.thrift.protocol.TProtocol iprot, TimRoster 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: // SUBSCRIPTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.subscription = iprot.readString();
              struct.setSubscriptionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.tid = new Tid();
              struct.tid.read(iprot);
              struct.setTidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // EXTRA_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map186 = iprot.readMapBegin();
                struct.extraMap = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map186.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key187;
                @org.apache.thrift.annotation.Nullable java.lang.String _val188;
                for (int _i189 = 0; _i189 < _map186.size; ++_i189)
                {
                  _key187 = iprot.readString();
                  _val188 = iprot.readString();
                  struct.extraMap.put(_key187, _val188);
                }
                iprot.readMapEnd();
              }
              struct.setExtraMapIsSet(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();
    }

    @Override
    public void write(org.apache.thrift.protocol.TProtocol oprot, TimRoster struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.subscription != null) {
        oprot.writeFieldBegin(SUBSCRIPTION_FIELD_DESC);
        oprot.writeString(struct.subscription);
        oprot.writeFieldEnd();
      }
      if (struct.tid != null) {
        oprot.writeFieldBegin(TID_FIELD_DESC);
        struct.tid.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.name != null) {
        if (struct.isSetName()) {
          oprot.writeFieldBegin(NAME_FIELD_DESC);
          oprot.writeString(struct.name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.extraMap != null) {
        if (struct.isSetExtraMap()) {
          oprot.writeFieldBegin(EXTRA_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.extraMap.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter190 : struct.extraMap.entrySet())
            {
              oprot.writeString(_iter190.getKey());
              oprot.writeString(_iter190.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TimRosterTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TimRosterTupleScheme getScheme() {
      return new TimRosterTupleScheme();
    }
  }

  private static class TimRosterTupleScheme extends org.apache.thrift.scheme.TupleScheme<TimRoster> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TimRoster struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.subscription);
      struct.tid.write(oprot);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetName()) {
        optionals.set(0);
      }
      if (struct.isSetExtraMap()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetExtraMap()) {
        {
          oprot.writeI32(struct.extraMap.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter191 : struct.extraMap.entrySet())
          {
            oprot.writeString(_iter191.getKey());
            oprot.writeString(_iter191.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TimRoster struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.subscription = iprot.readString();
      struct.setSubscriptionIsSet(true);
      struct.tid = new Tid();
      struct.tid.read(iprot);
      struct.setTidIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(2);
      if (incoming.get(0)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TMap _map192 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.extraMap = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map192.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key193;
          @org.apache.thrift.annotation.Nullable java.lang.String _val194;
          for (int _i195 = 0; _i195 < _map192.size; ++_i195)
          {
            _key193 = iprot.readString();
            _val194 = iprot.readString();
            struct.extraMap.put(_key193, _val194);
          }
        }
        struct.setExtraMapIsSet(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();
  }
}

