/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hadoop.hive.serde2.thrift.test;

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

  private static final org.apache.thrift.protocol.TField AINT_FIELD_DESC = new org.apache.thrift.protocol.TField("aint", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField A_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("aString", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField LINT_FIELD_DESC = new org.apache.thrift.protocol.TField("lint", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField L_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("lString", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField LINT_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("lintString", org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final org.apache.thrift.protocol.TField M_STRING_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("mStringString", org.apache.thrift.protocol.TType.MAP, (short)6);
  private static final org.apache.thrift.protocol.TField ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)7);
  private static final org.apache.thrift.protocol.TField UNION_FIELD1_FIELD_DESC = new org.apache.thrift.protocol.TField("unionField1", org.apache.thrift.protocol.TType.STRUCT, (short)8);
  private static final org.apache.thrift.protocol.TField UNION_FIELD2_FIELD_DESC = new org.apache.thrift.protocol.TField("unionField2", org.apache.thrift.protocol.TType.STRUCT, (short)9);
  private static final org.apache.thrift.protocol.TField UNION_FIELD3_FIELD_DESC = new org.apache.thrift.protocol.TField("unionField3", org.apache.thrift.protocol.TType.STRUCT, (short)10);

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

  private int aint; // required
  private @org.apache.thrift.annotation.Nullable java.lang.String aString; // required
  private @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> lint; // required
  private @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> lString; // required
  private @org.apache.thrift.annotation.Nullable java.util.List<IntString> lintString; // required
  private @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> mStringString; // required
  private @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>> attributes; // required
  private @org.apache.thrift.annotation.Nullable PropValueUnion unionField1; // required
  private @org.apache.thrift.annotation.Nullable PropValueUnion unionField2; // required
  private @org.apache.thrift.annotation.Nullable PropValueUnion unionField3; // 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 {
    AINT((short)1, "aint"),
    A_STRING((short)2, "aString"),
    LINT((short)3, "lint"),
    L_STRING((short)4, "lString"),
    LINT_STRING((short)5, "lintString"),
    M_STRING_STRING((short)6, "mStringString"),
    ATTRIBUTES((short)7, "attributes"),
    UNION_FIELD1((short)8, "unionField1"),
    UNION_FIELD2((short)9, "unionField2"),
    UNION_FIELD3((short)10, "unionField3");

    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: // AINT
          return AINT;
        case 2: // A_STRING
          return A_STRING;
        case 3: // LINT
          return LINT;
        case 4: // L_STRING
          return L_STRING;
        case 5: // LINT_STRING
          return LINT_STRING;
        case 6: // M_STRING_STRING
          return M_STRING_STRING;
        case 7: // ATTRIBUTES
          return ATTRIBUTES;
        case 8: // UNION_FIELD1
          return UNION_FIELD1;
        case 9: // UNION_FIELD2
          return UNION_FIELD2;
        case 10: // UNION_FIELD3
          return UNION_FIELD3;
        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;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final int __AINT_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  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.AINT, new org.apache.thrift.meta_data.FieldMetaData("aint", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.A_STRING, new org.apache.thrift.meta_data.FieldMetaData("aString", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.LINT, new org.apache.thrift.meta_data.FieldMetaData("lint", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        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.I32))));
    tmpMap.put(_Fields.L_STRING, new org.apache.thrift.meta_data.FieldMetaData("lString", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        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.LINT_STRING, new org.apache.thrift.meta_data.FieldMetaData("lintString", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        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, IntString.class))));
    tmpMap.put(_Fields.M_STRING_STRING, new org.apache.thrift.meta_data.FieldMetaData("mStringString", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", 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.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.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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PropValueUnion.class))))));
    tmpMap.put(_Fields.UNION_FIELD1, new org.apache.thrift.meta_data.FieldMetaData("unionField1", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PropValueUnion.class)));
    tmpMap.put(_Fields.UNION_FIELD2, new org.apache.thrift.meta_data.FieldMetaData("unionField2", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PropValueUnion.class)));
    tmpMap.put(_Fields.UNION_FIELD3, new org.apache.thrift.meta_data.FieldMetaData("unionField3", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PropValueUnion.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Complex.class, metaDataMap);
  }

  public Complex() {
  }

  public Complex(
    int aint,
    java.lang.String aString,
    java.util.List<java.lang.Integer> lint,
    java.util.List<java.lang.String> lString,
    java.util.List<IntString> lintString,
    java.util.Map<java.lang.String,java.lang.String> mStringString,
    java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>> attributes,
    PropValueUnion unionField1,
    PropValueUnion unionField2,
    PropValueUnion unionField3)
  {
    this();
    this.aint = aint;
    setAintIsSet(true);
    this.aString = aString;
    this.lint = lint;
    this.lString = lString;
    this.lintString = lintString;
    this.mStringString = mStringString;
    this.attributes = attributes;
    this.unionField1 = unionField1;
    this.unionField2 = unionField2;
    this.unionField3 = unionField3;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Complex(Complex other) {
    __isset_bitfield = other.__isset_bitfield;
    this.aint = other.aint;
    if (other.isSetAString()) {
      this.aString = other.aString;
    }
    if (other.isSetLint()) {
      java.util.List<java.lang.Integer> __this__lint = new java.util.ArrayList<java.lang.Integer>(other.lint);
      this.lint = __this__lint;
    }
    if (other.isSetLString()) {
      java.util.List<java.lang.String> __this__lString = new java.util.ArrayList<java.lang.String>(other.lString);
      this.lString = __this__lString;
    }
    if (other.isSetLintString()) {
      java.util.List<IntString> __this__lintString = new java.util.ArrayList<IntString>(other.lintString.size());
      for (IntString other_element : other.lintString) {
        __this__lintString.add(new IntString(other_element));
      }
      this.lintString = __this__lintString;
    }
    if (other.isSetMStringString()) {
      java.util.Map<java.lang.String,java.lang.String> __this__mStringString = new java.util.HashMap<java.lang.String,java.lang.String>(other.mStringString);
      this.mStringString = __this__mStringString;
    }
    if (other.isSetAttributes()) {
      java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>> __this__attributes = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>>(other.attributes.size());
      for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>> other_element : other.attributes.entrySet()) {

        java.lang.String other_element_key = other_element.getKey();
        java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>> other_element_value = other_element.getValue();

        java.lang.String __this__attributes_copy_key = other_element_key;

        java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>> __this__attributes_copy_value = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>(other_element_value.size());
        for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,PropValueUnion>> other_element_value_element : other_element_value.entrySet()) {

          java.lang.String other_element_value_element_key = other_element_value_element.getKey();
          java.util.Map<java.lang.String,PropValueUnion> other_element_value_element_value = other_element_value_element.getValue();

          java.lang.String __this__attributes_copy_value_copy_key = other_element_value_element_key;

          java.util.Map<java.lang.String,PropValueUnion> __this__attributes_copy_value_copy_value = new java.util.HashMap<java.lang.String,PropValueUnion>(other_element_value_element_value.size());
          for (java.util.Map.Entry<java.lang.String, PropValueUnion> other_element_value_element_value_element : other_element_value_element_value.entrySet()) {

            java.lang.String other_element_value_element_value_element_key = other_element_value_element_value_element.getKey();
            PropValueUnion other_element_value_element_value_element_value = other_element_value_element_value_element.getValue();

            java.lang.String __this__attributes_copy_value_copy_value_copy_key = other_element_value_element_value_element_key;

            PropValueUnion __this__attributes_copy_value_copy_value_copy_value = new PropValueUnion(other_element_value_element_value_element_value);

            __this__attributes_copy_value_copy_value.put(__this__attributes_copy_value_copy_value_copy_key, __this__attributes_copy_value_copy_value_copy_value);
          }

          __this__attributes_copy_value.put(__this__attributes_copy_value_copy_key, __this__attributes_copy_value_copy_value);
        }

        __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value);
      }
      this.attributes = __this__attributes;
    }
    if (other.isSetUnionField1()) {
      this.unionField1 = new PropValueUnion(other.unionField1);
    }
    if (other.isSetUnionField2()) {
      this.unionField2 = new PropValueUnion(other.unionField2);
    }
    if (other.isSetUnionField3()) {
      this.unionField3 = new PropValueUnion(other.unionField3);
    }
  }

  public Complex deepCopy() {
    return new Complex(this);
  }

  @Override
  public void clear() {
    setAintIsSet(false);
    this.aint = 0;
    this.aString = null;
    this.lint = null;
    this.lString = null;
    this.lintString = null;
    this.mStringString = null;
    this.attributes = null;
    this.unionField1 = null;
    this.unionField2 = null;
    this.unionField3 = null;
  }

  public int getAint() {
    return this.aint;
  }

  public void setAint(int aint) {
    this.aint = aint;
    setAintIsSet(true);
  }

  public void unsetAint() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __AINT_ISSET_ID);
  }

  /** Returns true if field aint is set (has been assigned a value) and false otherwise */
  public boolean isSetAint() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __AINT_ISSET_ID);
  }

  public void setAintIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __AINT_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getAString() {
    return this.aString;
  }

  public void setAString(@org.apache.thrift.annotation.Nullable java.lang.String aString) {
    this.aString = aString;
  }

  public void unsetAString() {
    this.aString = null;
  }

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

  public void setAStringIsSet(boolean value) {
    if (!value) {
      this.aString = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<java.lang.Integer> getLintIterator() {
    return (this.lint == null) ? null : this.lint.iterator();
  }

  public void addToLint(int elem) {
    if (this.lint == null) {
      this.lint = new java.util.ArrayList<java.lang.Integer>();
    }
    this.lint.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<java.lang.Integer> getLint() {
    return this.lint;
  }

  public void setLint(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> lint) {
    this.lint = lint;
  }

  public void unsetLint() {
    this.lint = null;
  }

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

  public void setLintIsSet(boolean value) {
    if (!value) {
      this.lint = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<java.lang.String> getLStringIterator() {
    return (this.lString == null) ? null : this.lString.iterator();
  }

  public void addToLString(java.lang.String elem) {
    if (this.lString == null) {
      this.lString = new java.util.ArrayList<java.lang.String>();
    }
    this.lString.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<java.lang.String> getLString() {
    return this.lString;
  }

  public void setLString(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> lString) {
    this.lString = lString;
  }

  public void unsetLString() {
    this.lString = null;
  }

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

  public void setLStringIsSet(boolean value) {
    if (!value) {
      this.lString = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<IntString> getLintStringIterator() {
    return (this.lintString == null) ? null : this.lintString.iterator();
  }

  public void addToLintString(IntString elem) {
    if (this.lintString == null) {
      this.lintString = new java.util.ArrayList<IntString>();
    }
    this.lintString.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<IntString> getLintString() {
    return this.lintString;
  }

  public void setLintString(@org.apache.thrift.annotation.Nullable java.util.List<IntString> lintString) {
    this.lintString = lintString;
  }

  public void unsetLintString() {
    this.lintString = null;
  }

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

  public void setLintStringIsSet(boolean value) {
    if (!value) {
      this.lintString = null;
    }
  }

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

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

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

  public void setMStringString(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> mStringString) {
    this.mStringString = mStringString;
  }

  public void unsetMStringString() {
    this.mStringString = null;
  }

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

  public void setMStringStringIsSet(boolean value) {
    if (!value) {
      this.mStringString = null;
    }
  }

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

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

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

  public void setAttributes(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>> attributes) {
    this.attributes = attributes;
  }

  public void unsetAttributes() {
    this.attributes = null;
  }

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

  public void setAttributesIsSet(boolean value) {
    if (!value) {
      this.attributes = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public PropValueUnion getUnionField1() {
    return this.unionField1;
  }

  public void setUnionField1(@org.apache.thrift.annotation.Nullable PropValueUnion unionField1) {
    this.unionField1 = unionField1;
  }

  public void unsetUnionField1() {
    this.unionField1 = null;
  }

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

  public void setUnionField1IsSet(boolean value) {
    if (!value) {
      this.unionField1 = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public PropValueUnion getUnionField2() {
    return this.unionField2;
  }

  public void setUnionField2(@org.apache.thrift.annotation.Nullable PropValueUnion unionField2) {
    this.unionField2 = unionField2;
  }

  public void unsetUnionField2() {
    this.unionField2 = null;
  }

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

  public void setUnionField2IsSet(boolean value) {
    if (!value) {
      this.unionField2 = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public PropValueUnion getUnionField3() {
    return this.unionField3;
  }

  public void setUnionField3(@org.apache.thrift.annotation.Nullable PropValueUnion unionField3) {
    this.unionField3 = unionField3;
  }

  public void unsetUnionField3() {
    this.unionField3 = null;
  }

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

  public void setUnionField3IsSet(boolean value) {
    if (!value) {
      this.unionField3 = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case AINT:
      if (value == null) {
        unsetAint();
      } else {
        setAint((java.lang.Integer)value);
      }
      break;

    case A_STRING:
      if (value == null) {
        unsetAString();
      } else {
        setAString((java.lang.String)value);
      }
      break;

    case LINT:
      if (value == null) {
        unsetLint();
      } else {
        setLint((java.util.List<java.lang.Integer>)value);
      }
      break;

    case L_STRING:
      if (value == null) {
        unsetLString();
      } else {
        setLString((java.util.List<java.lang.String>)value);
      }
      break;

    case LINT_STRING:
      if (value == null) {
        unsetLintString();
      } else {
        setLintString((java.util.List<IntString>)value);
      }
      break;

    case M_STRING_STRING:
      if (value == null) {
        unsetMStringString();
      } else {
        setMStringString((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case ATTRIBUTES:
      if (value == null) {
        unsetAttributes();
      } else {
        setAttributes((java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>>)value);
      }
      break;

    case UNION_FIELD1:
      if (value == null) {
        unsetUnionField1();
      } else {
        setUnionField1((PropValueUnion)value);
      }
      break;

    case UNION_FIELD2:
      if (value == null) {
        unsetUnionField2();
      } else {
        setUnionField2((PropValueUnion)value);
      }
      break;

    case UNION_FIELD3:
      if (value == null) {
        unsetUnionField3();
      } else {
        setUnionField3((PropValueUnion)value);
      }
      break;

    }
  }

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

    case A_STRING:
      return getAString();

    case LINT:
      return getLint();

    case L_STRING:
      return getLString();

    case LINT_STRING:
      return getLintString();

    case M_STRING_STRING:
      return getMStringString();

    case ATTRIBUTES:
      return getAttributes();

    case UNION_FIELD1:
      return getUnionField1();

    case UNION_FIELD2:
      return getUnionField2();

    case UNION_FIELD3:
      return getUnionField3();

    }
    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 AINT:
      return isSetAint();
    case A_STRING:
      return isSetAString();
    case LINT:
      return isSetLint();
    case L_STRING:
      return isSetLString();
    case LINT_STRING:
      return isSetLintString();
    case M_STRING_STRING:
      return isSetMStringString();
    case ATTRIBUTES:
      return isSetAttributes();
    case UNION_FIELD1:
      return isSetUnionField1();
    case UNION_FIELD2:
      return isSetUnionField2();
    case UNION_FIELD3:
      return isSetUnionField3();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_aint = true;
    boolean that_present_aint = true;
    if (this_present_aint || that_present_aint) {
      if (!(this_present_aint && that_present_aint))
        return false;
      if (this.aint != that.aint)
        return false;
    }

    boolean this_present_aString = true && this.isSetAString();
    boolean that_present_aString = true && that.isSetAString();
    if (this_present_aString || that_present_aString) {
      if (!(this_present_aString && that_present_aString))
        return false;
      if (!this.aString.equals(that.aString))
        return false;
    }

    boolean this_present_lint = true && this.isSetLint();
    boolean that_present_lint = true && that.isSetLint();
    if (this_present_lint || that_present_lint) {
      if (!(this_present_lint && that_present_lint))
        return false;
      if (!this.lint.equals(that.lint))
        return false;
    }

    boolean this_present_lString = true && this.isSetLString();
    boolean that_present_lString = true && that.isSetLString();
    if (this_present_lString || that_present_lString) {
      if (!(this_present_lString && that_present_lString))
        return false;
      if (!this.lString.equals(that.lString))
        return false;
    }

    boolean this_present_lintString = true && this.isSetLintString();
    boolean that_present_lintString = true && that.isSetLintString();
    if (this_present_lintString || that_present_lintString) {
      if (!(this_present_lintString && that_present_lintString))
        return false;
      if (!this.lintString.equals(that.lintString))
        return false;
    }

    boolean this_present_mStringString = true && this.isSetMStringString();
    boolean that_present_mStringString = true && that.isSetMStringString();
    if (this_present_mStringString || that_present_mStringString) {
      if (!(this_present_mStringString && that_present_mStringString))
        return false;
      if (!this.mStringString.equals(that.mStringString))
        return false;
    }

    boolean this_present_attributes = true && this.isSetAttributes();
    boolean that_present_attributes = true && that.isSetAttributes();
    if (this_present_attributes || that_present_attributes) {
      if (!(this_present_attributes && that_present_attributes))
        return false;
      if (!this.attributes.equals(that.attributes))
        return false;
    }

    boolean this_present_unionField1 = true && this.isSetUnionField1();
    boolean that_present_unionField1 = true && that.isSetUnionField1();
    if (this_present_unionField1 || that_present_unionField1) {
      if (!(this_present_unionField1 && that_present_unionField1))
        return false;
      if (!this.unionField1.equals(that.unionField1))
        return false;
    }

    boolean this_present_unionField2 = true && this.isSetUnionField2();
    boolean that_present_unionField2 = true && that.isSetUnionField2();
    if (this_present_unionField2 || that_present_unionField2) {
      if (!(this_present_unionField2 && that_present_unionField2))
        return false;
      if (!this.unionField2.equals(that.unionField2))
        return false;
    }

    boolean this_present_unionField3 = true && this.isSetUnionField3();
    boolean that_present_unionField3 = true && that.isSetUnionField3();
    if (this_present_unionField3 || that_present_unionField3) {
      if (!(this_present_unionField3 && that_present_unionField3))
        return false;
      if (!this.unionField3.equals(that.unionField3))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + aint;

    hashCode = hashCode * 8191 + ((isSetAString()) ? 131071 : 524287);
    if (isSetAString())
      hashCode = hashCode * 8191 + aString.hashCode();

    hashCode = hashCode * 8191 + ((isSetLint()) ? 131071 : 524287);
    if (isSetLint())
      hashCode = hashCode * 8191 + lint.hashCode();

    hashCode = hashCode * 8191 + ((isSetLString()) ? 131071 : 524287);
    if (isSetLString())
      hashCode = hashCode * 8191 + lString.hashCode();

    hashCode = hashCode * 8191 + ((isSetLintString()) ? 131071 : 524287);
    if (isSetLintString())
      hashCode = hashCode * 8191 + lintString.hashCode();

    hashCode = hashCode * 8191 + ((isSetMStringString()) ? 131071 : 524287);
    if (isSetMStringString())
      hashCode = hashCode * 8191 + mStringString.hashCode();

    hashCode = hashCode * 8191 + ((isSetAttributes()) ? 131071 : 524287);
    if (isSetAttributes())
      hashCode = hashCode * 8191 + attributes.hashCode();

    hashCode = hashCode * 8191 + ((isSetUnionField1()) ? 131071 : 524287);
    if (isSetUnionField1())
      hashCode = hashCode * 8191 + unionField1.hashCode();

    hashCode = hashCode * 8191 + ((isSetUnionField2()) ? 131071 : 524287);
    if (isSetUnionField2())
      hashCode = hashCode * 8191 + unionField2.hashCode();

    hashCode = hashCode * 8191 + ((isSetUnionField3()) ? 131071 : 524287);
    if (isSetUnionField3())
      hashCode = hashCode * 8191 + unionField3.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetAint(), other.isSetAint());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAint()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aint, other.aint);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetAString(), other.isSetAString());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAString()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aString, other.aString);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLint(), other.isSetLint());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLint()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lint, other.lint);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLString(), other.isSetLString());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLString()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lString, other.lString);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLintString(), other.isSetLintString());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLintString()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lintString, other.lintString);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMStringString(), other.isSetMStringString());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMStringString()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mStringString, other.mStringString);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetAttributes(), other.isSetAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attributes, other.attributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUnionField1(), other.isSetUnionField1());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUnionField1()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unionField1, other.unionField1);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUnionField2(), other.isSetUnionField2());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUnionField2()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unionField2, other.unionField2);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUnionField3(), other.isSetUnionField3());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUnionField3()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unionField3, other.unionField3);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  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("Complex(");
    boolean first = true;

    sb.append("aint:");
    sb.append(this.aint);
    first = false;
    if (!first) sb.append(", ");
    sb.append("aString:");
    if (this.aString == null) {
      sb.append("null");
    } else {
      sb.append(this.aString);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("lint:");
    if (this.lint == null) {
      sb.append("null");
    } else {
      sb.append(this.lint);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("lString:");
    if (this.lString == null) {
      sb.append("null");
    } else {
      sb.append(this.lString);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("lintString:");
    if (this.lintString == null) {
      sb.append("null");
    } else {
      sb.append(this.lintString);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("mStringString:");
    if (this.mStringString == null) {
      sb.append("null");
    } else {
      sb.append(this.mStringString);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("attributes:");
    if (this.attributes == null) {
      sb.append("null");
    } else {
      sb.append(this.attributes);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("unionField1:");
    if (this.unionField1 == null) {
      sb.append("null");
    } else {
      sb.append(this.unionField1);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("unionField2:");
    if (this.unionField2 == null) {
      sb.append("null");
    } else {
      sb.append(this.unionField2);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("unionField3:");
    if (this.unionField3 == null) {
      sb.append("null");
    } else {
      sb.append(this.unionField3);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // 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 {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      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 ComplexStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ComplexStandardScheme getScheme() {
      return new ComplexStandardScheme();
    }
  }

  private static class ComplexStandardScheme extends org.apache.thrift.scheme.StandardScheme<Complex> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, Complex 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: // AINT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.aint = iprot.readI32();
              struct.setAintIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // A_STRING
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.aString = iprot.readString();
              struct.setAStringIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LINT
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list18 = iprot.readListBegin();
                struct.lint = new java.util.ArrayList<java.lang.Integer>(_list18.size);
                int _elem19;
                for (int _i20 = 0; _i20 < _list18.size; ++_i20)
                {
                  _elem19 = iprot.readI32();
                  struct.lint.add(_elem19);
                }
                iprot.readListEnd();
              }
              struct.setLintIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // L_STRING
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
                struct.lString = new java.util.ArrayList<java.lang.String>(_list21.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem22;
                for (int _i23 = 0; _i23 < _list21.size; ++_i23)
                {
                  _elem22 = iprot.readString();
                  struct.lString.add(_elem22);
                }
                iprot.readListEnd();
              }
              struct.setLStringIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // LINT_STRING
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
                struct.lintString = new java.util.ArrayList<IntString>(_list24.size);
                @org.apache.thrift.annotation.Nullable IntString _elem25;
                for (int _i26 = 0; _i26 < _list24.size; ++_i26)
                {
                  _elem25 = new IntString();
                  _elem25.read(iprot);
                  struct.lintString.add(_elem25);
                }
                iprot.readListEnd();
              }
              struct.setLintStringIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // M_STRING_STRING
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map27 = iprot.readMapBegin();
                struct.mStringString = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map27.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key28;
                @org.apache.thrift.annotation.Nullable java.lang.String _val29;
                for (int _i30 = 0; _i30 < _map27.size; ++_i30)
                {
                  _key28 = iprot.readString();
                  _val29 = iprot.readString();
                  struct.mStringString.put(_key28, _val29);
                }
                iprot.readMapEnd();
              }
              struct.setMStringStringIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map31 = iprot.readMapBegin();
                struct.attributes = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>>(2*_map31.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key32;
                @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>> _val33;
                for (int _i34 = 0; _i34 < _map31.size; ++_i34)
                {
                  _key32 = iprot.readString();
                  {
                    org.apache.thrift.protocol.TMap _map35 = iprot.readMapBegin();
                    _val33 = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>(2*_map35.size);
                    @org.apache.thrift.annotation.Nullable java.lang.String _key36;
                    @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,PropValueUnion> _val37;
                    for (int _i38 = 0; _i38 < _map35.size; ++_i38)
                    {
                      _key36 = iprot.readString();
                      {
                        org.apache.thrift.protocol.TMap _map39 = iprot.readMapBegin();
                        _val37 = new java.util.HashMap<java.lang.String,PropValueUnion>(2*_map39.size);
                        @org.apache.thrift.annotation.Nullable java.lang.String _key40;
                        @org.apache.thrift.annotation.Nullable PropValueUnion _val41;
                        for (int _i42 = 0; _i42 < _map39.size; ++_i42)
                        {
                          _key40 = iprot.readString();
                          _val41 = new PropValueUnion();
                          _val41.read(iprot);
                          _val37.put(_key40, _val41);
                        }
                        iprot.readMapEnd();
                      }
                      _val33.put(_key36, _val37);
                    }
                    iprot.readMapEnd();
                  }
                  struct.attributes.put(_key32, _val33);
                }
                iprot.readMapEnd();
              }
              struct.setAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // UNION_FIELD1
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.unionField1 = new PropValueUnion();
              struct.unionField1.read(iprot);
              struct.setUnionField1IsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // UNION_FIELD2
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.unionField2 = new PropValueUnion();
              struct.unionField2.read(iprot);
              struct.setUnionField2IsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // UNION_FIELD3
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.unionField3 = new PropValueUnion();
              struct.unionField3.read(iprot);
              struct.setUnionField3IsSet(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, Complex struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(AINT_FIELD_DESC);
      oprot.writeI32(struct.aint);
      oprot.writeFieldEnd();
      if (struct.aString != null) {
        oprot.writeFieldBegin(A_STRING_FIELD_DESC);
        oprot.writeString(struct.aString);
        oprot.writeFieldEnd();
      }
      if (struct.lint != null) {
        oprot.writeFieldBegin(LINT_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.lint.size()));
          for (int _iter43 : struct.lint)
          {
            oprot.writeI32(_iter43);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.lString != null) {
        oprot.writeFieldBegin(L_STRING_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.lString.size()));
          for (java.lang.String _iter44 : struct.lString)
          {
            oprot.writeString(_iter44);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.lintString != null) {
        oprot.writeFieldBegin(LINT_STRING_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.lintString.size()));
          for (IntString _iter45 : struct.lintString)
          {
            _iter45.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.mStringString != null) {
        oprot.writeFieldBegin(M_STRING_STRING_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.mStringString.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter46 : struct.mStringString.entrySet())
          {
            oprot.writeString(_iter46.getKey());
            oprot.writeString(_iter46.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.attributes != null) {
        oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.attributes.size()));
          for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>> _iter47 : struct.attributes.entrySet())
          {
            oprot.writeString(_iter47.getKey());
            {
              oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, _iter47.getValue().size()));
              for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,PropValueUnion>> _iter48 : _iter47.getValue().entrySet())
              {
                oprot.writeString(_iter48.getKey());
                {
                  oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, _iter48.getValue().size()));
                  for (java.util.Map.Entry<java.lang.String, PropValueUnion> _iter49 : _iter48.getValue().entrySet())
                  {
                    oprot.writeString(_iter49.getKey());
                    _iter49.getValue().write(oprot);
                  }
                  oprot.writeMapEnd();
                }
              }
              oprot.writeMapEnd();
            }
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.unionField1 != null) {
        oprot.writeFieldBegin(UNION_FIELD1_FIELD_DESC);
        struct.unionField1.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.unionField2 != null) {
        oprot.writeFieldBegin(UNION_FIELD2_FIELD_DESC);
        struct.unionField2.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.unionField3 != null) {
        oprot.writeFieldBegin(UNION_FIELD3_FIELD_DESC);
        struct.unionField3.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ComplexTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ComplexTupleScheme getScheme() {
      return new ComplexTupleScheme();
    }
  }

  private static class ComplexTupleScheme extends org.apache.thrift.scheme.TupleScheme<Complex> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Complex struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetAint()) {
        optionals.set(0);
      }
      if (struct.isSetAString()) {
        optionals.set(1);
      }
      if (struct.isSetLint()) {
        optionals.set(2);
      }
      if (struct.isSetLString()) {
        optionals.set(3);
      }
      if (struct.isSetLintString()) {
        optionals.set(4);
      }
      if (struct.isSetMStringString()) {
        optionals.set(5);
      }
      if (struct.isSetAttributes()) {
        optionals.set(6);
      }
      if (struct.isSetUnionField1()) {
        optionals.set(7);
      }
      if (struct.isSetUnionField2()) {
        optionals.set(8);
      }
      if (struct.isSetUnionField3()) {
        optionals.set(9);
      }
      oprot.writeBitSet(optionals, 10);
      if (struct.isSetAint()) {
        oprot.writeI32(struct.aint);
      }
      if (struct.isSetAString()) {
        oprot.writeString(struct.aString);
      }
      if (struct.isSetLint()) {
        {
          oprot.writeI32(struct.lint.size());
          for (int _iter50 : struct.lint)
          {
            oprot.writeI32(_iter50);
          }
        }
      }
      if (struct.isSetLString()) {
        {
          oprot.writeI32(struct.lString.size());
          for (java.lang.String _iter51 : struct.lString)
          {
            oprot.writeString(_iter51);
          }
        }
      }
      if (struct.isSetLintString()) {
        {
          oprot.writeI32(struct.lintString.size());
          for (IntString _iter52 : struct.lintString)
          {
            _iter52.write(oprot);
          }
        }
      }
      if (struct.isSetMStringString()) {
        {
          oprot.writeI32(struct.mStringString.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter53 : struct.mStringString.entrySet())
          {
            oprot.writeString(_iter53.getKey());
            oprot.writeString(_iter53.getValue());
          }
        }
      }
      if (struct.isSetAttributes()) {
        {
          oprot.writeI32(struct.attributes.size());
          for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>> _iter54 : struct.attributes.entrySet())
          {
            oprot.writeString(_iter54.getKey());
            {
              oprot.writeI32(_iter54.getValue().size());
              for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,PropValueUnion>> _iter55 : _iter54.getValue().entrySet())
              {
                oprot.writeString(_iter55.getKey());
                {
                  oprot.writeI32(_iter55.getValue().size());
                  for (java.util.Map.Entry<java.lang.String, PropValueUnion> _iter56 : _iter55.getValue().entrySet())
                  {
                    oprot.writeString(_iter56.getKey());
                    _iter56.getValue().write(oprot);
                  }
                }
              }
            }
          }
        }
      }
      if (struct.isSetUnionField1()) {
        struct.unionField1.write(oprot);
      }
      if (struct.isSetUnionField2()) {
        struct.unionField2.write(oprot);
      }
      if (struct.isSetUnionField3()) {
        struct.unionField3.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Complex struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(10);
      if (incoming.get(0)) {
        struct.aint = iprot.readI32();
        struct.setAintIsSet(true);
      }
      if (incoming.get(1)) {
        struct.aString = iprot.readString();
        struct.setAStringIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list57 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
          struct.lint = new java.util.ArrayList<java.lang.Integer>(_list57.size);
          int _elem58;
          for (int _i59 = 0; _i59 < _list57.size; ++_i59)
          {
            _elem58 = iprot.readI32();
            struct.lint.add(_elem58);
          }
        }
        struct.setLintIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list60 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
          struct.lString = new java.util.ArrayList<java.lang.String>(_list60.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _elem61;
          for (int _i62 = 0; _i62 < _list60.size; ++_i62)
          {
            _elem61 = iprot.readString();
            struct.lString.add(_elem61);
          }
        }
        struct.setLStringIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TList _list63 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.lintString = new java.util.ArrayList<IntString>(_list63.size);
          @org.apache.thrift.annotation.Nullable IntString _elem64;
          for (int _i65 = 0; _i65 < _list63.size; ++_i65)
          {
            _elem64 = new IntString();
            _elem64.read(iprot);
            struct.lintString.add(_elem64);
          }
        }
        struct.setLintStringIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TMap _map66 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.mStringString = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map66.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key67;
          @org.apache.thrift.annotation.Nullable java.lang.String _val68;
          for (int _i69 = 0; _i69 < _map66.size; ++_i69)
          {
            _key67 = iprot.readString();
            _val68 = iprot.readString();
            struct.mStringString.put(_key67, _val68);
          }
        }
        struct.setMStringStringIsSet(true);
      }
      if (incoming.get(6)) {
        {
          org.apache.thrift.protocol.TMap _map70 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP); 
          struct.attributes = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>>(2*_map70.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key71;
          @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>> _val72;
          for (int _i73 = 0; _i73 < _map70.size; ++_i73)
          {
            _key71 = iprot.readString();
            {
              org.apache.thrift.protocol.TMap _map74 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP); 
              _val72 = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,PropValueUnion>>(2*_map74.size);
              @org.apache.thrift.annotation.Nullable java.lang.String _key75;
              @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,PropValueUnion> _val76;
              for (int _i77 = 0; _i77 < _map74.size; ++_i77)
              {
                _key75 = iprot.readString();
                {
                  org.apache.thrift.protocol.TMap _map78 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT); 
                  _val76 = new java.util.HashMap<java.lang.String,PropValueUnion>(2*_map78.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _key79;
                  @org.apache.thrift.annotation.Nullable PropValueUnion _val80;
                  for (int _i81 = 0; _i81 < _map78.size; ++_i81)
                  {
                    _key79 = iprot.readString();
                    _val80 = new PropValueUnion();
                    _val80.read(iprot);
                    _val76.put(_key79, _val80);
                  }
                }
                _val72.put(_key75, _val76);
              }
            }
            struct.attributes.put(_key71, _val72);
          }
        }
        struct.setAttributesIsSet(true);
      }
      if (incoming.get(7)) {
        struct.unionField1 = new PropValueUnion();
        struct.unionField1.read(iprot);
        struct.setUnionField1IsSet(true);
      }
      if (incoming.get(8)) {
        struct.unionField2 = new PropValueUnion();
        struct.unionField2.read(iprot);
        struct.setUnionField2IsSet(true);
      }
      if (incoming.get(9)) {
        struct.unionField3 = new PropValueUnion();
        struct.unionField3.read(iprot);
        struct.setUnionField3IsSet(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();
  }
}

