All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hadoop.hive.serde2.thrift.test.MegaStruct Maven / Gradle / Ivy

There is a newer version: 3.1.2-23
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hadoop.hive.serde2.thrift.test;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import io.trino.hive.$internal.org.slf4j.Logger;
import io.trino.hive.$internal.org.slf4j.LoggerFactory;

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

  private static final org.apache.thrift.protocol.TField MY_BOOL_FIELD_DESC = new org.apache.thrift.protocol.TField("my_bool", org.apache.thrift.protocol.TType.BOOL, (short)1);
  private static final org.apache.thrift.protocol.TField MY_BYTE_FIELD_DESC = new org.apache.thrift.protocol.TField("my_byte", org.apache.thrift.protocol.TType.BYTE, (short)2);
  private static final org.apache.thrift.protocol.TField MY_16BIT_INT_FIELD_DESC = new org.apache.thrift.protocol.TField("my_16bit_int", org.apache.thrift.protocol.TType.I16, (short)3);
  private static final org.apache.thrift.protocol.TField MY_32BIT_INT_FIELD_DESC = new org.apache.thrift.protocol.TField("my_32bit_int", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField MY_64BIT_INT_FIELD_DESC = new org.apache.thrift.protocol.TField("my_64bit_int", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField MY_DOUBLE_FIELD_DESC = new org.apache.thrift.protocol.TField("my_double", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
  private static final org.apache.thrift.protocol.TField MY_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("my_string", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField MY_BINARY_FIELD_DESC = new org.apache.thrift.protocol.TField("my_binary", org.apache.thrift.protocol.TType.STRING, (short)8);
  private static final org.apache.thrift.protocol.TField MY_STRING_STRING_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("my_string_string_map", org.apache.thrift.protocol.TType.MAP, (short)9);
  private static final org.apache.thrift.protocol.TField MY_STRING_ENUM_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("my_string_enum_map", org.apache.thrift.protocol.TType.MAP, (short)10);
  private static final org.apache.thrift.protocol.TField MY_ENUM_STRING_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("my_enum_string_map", org.apache.thrift.protocol.TType.MAP, (short)11);
  private static final org.apache.thrift.protocol.TField MY_ENUM_STRUCT_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("my_enum_struct_map", org.apache.thrift.protocol.TType.MAP, (short)12);
  private static final org.apache.thrift.protocol.TField MY_ENUM_STRINGLIST_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("my_enum_stringlist_map", org.apache.thrift.protocol.TType.MAP, (short)13);
  private static final org.apache.thrift.protocol.TField MY_ENUM_STRUCTLIST_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("my_enum_structlist_map", org.apache.thrift.protocol.TType.MAP, (short)14);
  private static final org.apache.thrift.protocol.TField MY_STRINGLIST_FIELD_DESC = new org.apache.thrift.protocol.TField("my_stringlist", org.apache.thrift.protocol.TType.LIST, (short)15);
  private static final org.apache.thrift.protocol.TField MY_STRUCTLIST_FIELD_DESC = new org.apache.thrift.protocol.TField("my_structlist", org.apache.thrift.protocol.TType.LIST, (short)16);
  private static final org.apache.thrift.protocol.TField MY_ENUMLIST_FIELD_DESC = new org.apache.thrift.protocol.TField("my_enumlist", org.apache.thrift.protocol.TType.LIST, (short)17);
  private static final org.apache.thrift.protocol.TField MY_STRINGSET_FIELD_DESC = new org.apache.thrift.protocol.TField("my_stringset", org.apache.thrift.protocol.TType.SET, (short)18);
  private static final org.apache.thrift.protocol.TField MY_ENUMSET_FIELD_DESC = new org.apache.thrift.protocol.TField("my_enumset", org.apache.thrift.protocol.TType.SET, (short)19);
  private static final org.apache.thrift.protocol.TField MY_STRUCTSET_FIELD_DESC = new org.apache.thrift.protocol.TField("my_structset", org.apache.thrift.protocol.TType.SET, (short)20);

  private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new MegaStructStandardSchemeFactory());
    schemes.put(TupleScheme.class, new MegaStructTupleSchemeFactory());
  }

  private boolean my_bool; // optional
  private byte my_byte; // optional
  private short my_16bit_int; // optional
  private int my_32bit_int; // optional
  private long my_64bit_int; // optional
  private double my_double; // optional
  private String my_string; // optional
  private ByteBuffer my_binary; // optional
  private Map my_string_string_map; // optional
  private Map my_string_enum_map; // optional
  private Map my_enum_string_map; // optional
  private Map my_enum_struct_map; // optional
  private Map> my_enum_stringlist_map; // optional
  private Map> my_enum_structlist_map; // optional
  private List my_stringlist; // optional
  private List my_structlist; // optional
  private List my_enumlist; // optional
  private Set my_stringset; // optional
  private Set my_enumset; // optional
  private Set my_structset; // 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 {
    MY_BOOL((short)1, "my_bool"),
    MY_BYTE((short)2, "my_byte"),
    MY_16BIT_INT((short)3, "my_16bit_int"),
    MY_32BIT_INT((short)4, "my_32bit_int"),
    MY_64BIT_INT((short)5, "my_64bit_int"),
    MY_DOUBLE((short)6, "my_double"),
    MY_STRING((short)7, "my_string"),
    MY_BINARY((short)8, "my_binary"),
    MY_STRING_STRING_MAP((short)9, "my_string_string_map"),
    MY_STRING_ENUM_MAP((short)10, "my_string_enum_map"),
    MY_ENUM_STRING_MAP((short)11, "my_enum_string_map"),
    MY_ENUM_STRUCT_MAP((short)12, "my_enum_struct_map"),
    MY_ENUM_STRINGLIST_MAP((short)13, "my_enum_stringlist_map"),
    MY_ENUM_STRUCTLIST_MAP((short)14, "my_enum_structlist_map"),
    MY_STRINGLIST((short)15, "my_stringlist"),
    MY_STRUCTLIST((short)16, "my_structlist"),
    MY_ENUMLIST((short)17, "my_enumlist"),
    MY_STRINGSET((short)18, "my_stringset"),
    MY_ENUMSET((short)19, "my_enumset"),
    MY_STRUCTSET((short)20, "my_structset");

    private static final Map byName = new HashMap();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // MY_BOOL
          return MY_BOOL;
        case 2: // MY_BYTE
          return MY_BYTE;
        case 3: // MY_16BIT_INT
          return MY_16BIT_INT;
        case 4: // MY_32BIT_INT
          return MY_32BIT_INT;
        case 5: // MY_64BIT_INT
          return MY_64BIT_INT;
        case 6: // MY_DOUBLE
          return MY_DOUBLE;
        case 7: // MY_STRING
          return MY_STRING;
        case 8: // MY_BINARY
          return MY_BINARY;
        case 9: // MY_STRING_STRING_MAP
          return MY_STRING_STRING_MAP;
        case 10: // MY_STRING_ENUM_MAP
          return MY_STRING_ENUM_MAP;
        case 11: // MY_ENUM_STRING_MAP
          return MY_ENUM_STRING_MAP;
        case 12: // MY_ENUM_STRUCT_MAP
          return MY_ENUM_STRUCT_MAP;
        case 13: // MY_ENUM_STRINGLIST_MAP
          return MY_ENUM_STRINGLIST_MAP;
        case 14: // MY_ENUM_STRUCTLIST_MAP
          return MY_ENUM_STRUCTLIST_MAP;
        case 15: // MY_STRINGLIST
          return MY_STRINGLIST;
        case 16: // MY_STRUCTLIST
          return MY_STRUCTLIST;
        case 17: // MY_ENUMLIST
          return MY_ENUMLIST;
        case 18: // MY_STRINGSET
          return MY_STRINGSET;
        case 19: // MY_ENUMSET
          return MY_ENUMSET;
        case 20: // MY_STRUCTSET
          return MY_STRUCTSET;
        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 __MY_BOOL_ISSET_ID = 0;
  private static final int __MY_BYTE_ISSET_ID = 1;
  private static final int __MY_16BIT_INT_ISSET_ID = 2;
  private static final int __MY_32BIT_INT_ISSET_ID = 3;
  private static final int __MY_64BIT_INT_ISSET_ID = 4;
  private static final int __MY_DOUBLE_ISSET_ID = 5;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.MY_BOOL,_Fields.MY_BYTE,_Fields.MY_16BIT_INT,_Fields.MY_32BIT_INT,_Fields.MY_64BIT_INT,_Fields.MY_DOUBLE,_Fields.MY_STRING,_Fields.MY_BINARY,_Fields.MY_STRING_STRING_MAP,_Fields.MY_STRING_ENUM_MAP,_Fields.MY_ENUM_STRING_MAP,_Fields.MY_ENUM_STRUCT_MAP,_Fields.MY_ENUM_STRINGLIST_MAP,_Fields.MY_ENUM_STRUCTLIST_MAP,_Fields.MY_STRINGLIST,_Fields.MY_STRUCTLIST,_Fields.MY_ENUMLIST,_Fields.MY_STRINGSET,_Fields.MY_ENUMSET,_Fields.MY_STRUCTSET};
  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.MY_BOOL, new org.apache.thrift.meta_data.FieldMetaData("my_bool", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.MY_BYTE, new org.apache.thrift.meta_data.FieldMetaData("my_byte", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
    tmpMap.put(_Fields.MY_16BIT_INT, new org.apache.thrift.meta_data.FieldMetaData("my_16bit_int", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    tmpMap.put(_Fields.MY_32BIT_INT, new org.apache.thrift.meta_data.FieldMetaData("my_32bit_int", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MY_64BIT_INT, new org.apache.thrift.meta_data.FieldMetaData("my_64bit_int", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MY_DOUBLE, new org.apache.thrift.meta_data.FieldMetaData("my_double", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.MY_STRING, new org.apache.thrift.meta_data.FieldMetaData("my_string", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.MY_BINARY, new org.apache.thrift.meta_data.FieldMetaData("my_binary", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.MY_STRING_STRING_MAP, new org.apache.thrift.meta_data.FieldMetaData("my_string_string_map", 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))));
    tmpMap.put(_Fields.MY_STRING_ENUM_MAP, new org.apache.thrift.meta_data.FieldMetaData("my_string_enum_map", 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MyEnum.class))));
    tmpMap.put(_Fields.MY_ENUM_STRING_MAP, new org.apache.thrift.meta_data.FieldMetaData("my_enum_string_map", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MyEnum.class), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.MY_ENUM_STRUCT_MAP, new org.apache.thrift.meta_data.FieldMetaData("my_enum_struct_map", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MyEnum.class), 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MiniStruct.class))));
    tmpMap.put(_Fields.MY_ENUM_STRINGLIST_MAP, new org.apache.thrift.meta_data.FieldMetaData("my_enum_stringlist_map", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MyEnum.class), 
            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.MY_ENUM_STRUCTLIST_MAP, new org.apache.thrift.meta_data.FieldMetaData("my_enum_structlist_map", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MyEnum.class), 
            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, MiniStruct.class)))));
    tmpMap.put(_Fields.MY_STRINGLIST, new org.apache.thrift.meta_data.FieldMetaData("my_stringlist", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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.MY_STRUCTLIST, new org.apache.thrift.meta_data.FieldMetaData("my_structlist", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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, MiniStruct.class))));
    tmpMap.put(_Fields.MY_ENUMLIST, new org.apache.thrift.meta_data.FieldMetaData("my_enumlist", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MyEnum.class))));
    tmpMap.put(_Fields.MY_STRINGSET, new org.apache.thrift.meta_data.FieldMetaData("my_stringset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.MY_ENUMSET, new org.apache.thrift.meta_data.FieldMetaData("my_enumset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MyEnum.class))));
    tmpMap.put(_Fields.MY_STRUCTSET, new org.apache.thrift.meta_data.FieldMetaData("my_structset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MiniStruct.class))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MegaStruct.class, metaDataMap);
  }

  public MegaStruct() {
  }

  /**
   * Performs a deep copy on other.
   */
  public MegaStruct(MegaStruct other) {
    __isset_bitfield = other.__isset_bitfield;
    this.my_bool = other.my_bool;
    this.my_byte = other.my_byte;
    this.my_16bit_int = other.my_16bit_int;
    this.my_32bit_int = other.my_32bit_int;
    this.my_64bit_int = other.my_64bit_int;
    this.my_double = other.my_double;
    if (other.isSetMy_string()) {
      this.my_string = other.my_string;
    }
    if (other.isSetMy_binary()) {
      this.my_binary = org.apache.thrift.TBaseHelper.copyBinary(other.my_binary);
    }
    if (other.isSetMy_string_string_map()) {
      Map __this__my_string_string_map = new HashMap(other.my_string_string_map);
      this.my_string_string_map = __this__my_string_string_map;
    }
    if (other.isSetMy_string_enum_map()) {
      Map __this__my_string_enum_map = new HashMap(other.my_string_enum_map.size());
      for (Map.Entry other_element : other.my_string_enum_map.entrySet()) {

        String other_element_key = other_element.getKey();
        MyEnum other_element_value = other_element.getValue();

        String __this__my_string_enum_map_copy_key = other_element_key;

        MyEnum __this__my_string_enum_map_copy_value = other_element_value;

        __this__my_string_enum_map.put(__this__my_string_enum_map_copy_key, __this__my_string_enum_map_copy_value);
      }
      this.my_string_enum_map = __this__my_string_enum_map;
    }
    if (other.isSetMy_enum_string_map()) {
      Map __this__my_enum_string_map = new HashMap(other.my_enum_string_map.size());
      for (Map.Entry other_element : other.my_enum_string_map.entrySet()) {

        MyEnum other_element_key = other_element.getKey();
        String other_element_value = other_element.getValue();

        MyEnum __this__my_enum_string_map_copy_key = other_element_key;

        String __this__my_enum_string_map_copy_value = other_element_value;

        __this__my_enum_string_map.put(__this__my_enum_string_map_copy_key, __this__my_enum_string_map_copy_value);
      }
      this.my_enum_string_map = __this__my_enum_string_map;
    }
    if (other.isSetMy_enum_struct_map()) {
      Map __this__my_enum_struct_map = new HashMap(other.my_enum_struct_map.size());
      for (Map.Entry other_element : other.my_enum_struct_map.entrySet()) {

        MyEnum other_element_key = other_element.getKey();
        MiniStruct other_element_value = other_element.getValue();

        MyEnum __this__my_enum_struct_map_copy_key = other_element_key;

        MiniStruct __this__my_enum_struct_map_copy_value = new MiniStruct(other_element_value);

        __this__my_enum_struct_map.put(__this__my_enum_struct_map_copy_key, __this__my_enum_struct_map_copy_value);
      }
      this.my_enum_struct_map = __this__my_enum_struct_map;
    }
    if (other.isSetMy_enum_stringlist_map()) {
      Map> __this__my_enum_stringlist_map = new HashMap>(other.my_enum_stringlist_map.size());
      for (Map.Entry> other_element : other.my_enum_stringlist_map.entrySet()) {

        MyEnum other_element_key = other_element.getKey();
        List other_element_value = other_element.getValue();

        MyEnum __this__my_enum_stringlist_map_copy_key = other_element_key;

        List __this__my_enum_stringlist_map_copy_value = new ArrayList(other_element_value);

        __this__my_enum_stringlist_map.put(__this__my_enum_stringlist_map_copy_key, __this__my_enum_stringlist_map_copy_value);
      }
      this.my_enum_stringlist_map = __this__my_enum_stringlist_map;
    }
    if (other.isSetMy_enum_structlist_map()) {
      Map> __this__my_enum_structlist_map = new HashMap>(other.my_enum_structlist_map.size());
      for (Map.Entry> other_element : other.my_enum_structlist_map.entrySet()) {

        MyEnum other_element_key = other_element.getKey();
        List other_element_value = other_element.getValue();

        MyEnum __this__my_enum_structlist_map_copy_key = other_element_key;

        List __this__my_enum_structlist_map_copy_value = new ArrayList(other_element_value.size());
        for (MiniStruct other_element_value_element : other_element_value) {
          __this__my_enum_structlist_map_copy_value.add(new MiniStruct(other_element_value_element));
        }

        __this__my_enum_structlist_map.put(__this__my_enum_structlist_map_copy_key, __this__my_enum_structlist_map_copy_value);
      }
      this.my_enum_structlist_map = __this__my_enum_structlist_map;
    }
    if (other.isSetMy_stringlist()) {
      List __this__my_stringlist = new ArrayList(other.my_stringlist);
      this.my_stringlist = __this__my_stringlist;
    }
    if (other.isSetMy_structlist()) {
      List __this__my_structlist = new ArrayList(other.my_structlist.size());
      for (MiniStruct other_element : other.my_structlist) {
        __this__my_structlist.add(new MiniStruct(other_element));
      }
      this.my_structlist = __this__my_structlist;
    }
    if (other.isSetMy_enumlist()) {
      List __this__my_enumlist = new ArrayList(other.my_enumlist.size());
      for (MyEnum other_element : other.my_enumlist) {
        __this__my_enumlist.add(other_element);
      }
      this.my_enumlist = __this__my_enumlist;
    }
    if (other.isSetMy_stringset()) {
      Set __this__my_stringset = new HashSet(other.my_stringset);
      this.my_stringset = __this__my_stringset;
    }
    if (other.isSetMy_enumset()) {
      Set __this__my_enumset = new HashSet(other.my_enumset.size());
      for (MyEnum other_element : other.my_enumset) {
        __this__my_enumset.add(other_element);
      }
      this.my_enumset = __this__my_enumset;
    }
    if (other.isSetMy_structset()) {
      Set __this__my_structset = new HashSet(other.my_structset.size());
      for (MiniStruct other_element : other.my_structset) {
        __this__my_structset.add(new MiniStruct(other_element));
      }
      this.my_structset = __this__my_structset;
    }
  }

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

  @Override
  public void clear() {
    setMy_boolIsSet(false);
    this.my_bool = false;
    setMy_byteIsSet(false);
    this.my_byte = 0;
    setMy_16bit_intIsSet(false);
    this.my_16bit_int = 0;
    setMy_32bit_intIsSet(false);
    this.my_32bit_int = 0;
    setMy_64bit_intIsSet(false);
    this.my_64bit_int = 0;
    setMy_doubleIsSet(false);
    this.my_double = 0.0;
    this.my_string = null;
    this.my_binary = null;
    this.my_string_string_map = null;
    this.my_string_enum_map = null;
    this.my_enum_string_map = null;
    this.my_enum_struct_map = null;
    this.my_enum_stringlist_map = null;
    this.my_enum_structlist_map = null;
    this.my_stringlist = null;
    this.my_structlist = null;
    this.my_enumlist = null;
    this.my_stringset = null;
    this.my_enumset = null;
    this.my_structset = null;
  }

  public boolean isMy_bool() {
    return this.my_bool;
  }

  public void setMy_bool(boolean my_bool) {
    this.my_bool = my_bool;
    setMy_boolIsSet(true);
  }

  public void unsetMy_bool() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MY_BOOL_ISSET_ID);
  }

  /** Returns true if field my_bool is set (has been assigned a value) and false otherwise */
  public boolean isSetMy_bool() {
    return EncodingUtils.testBit(__isset_bitfield, __MY_BOOL_ISSET_ID);
  }

  public void setMy_boolIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MY_BOOL_ISSET_ID, value);
  }

  public byte getMy_byte() {
    return this.my_byte;
  }

  public void setMy_byte(byte my_byte) {
    this.my_byte = my_byte;
    setMy_byteIsSet(true);
  }

  public void unsetMy_byte() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MY_BYTE_ISSET_ID);
  }

  /** Returns true if field my_byte is set (has been assigned a value) and false otherwise */
  public boolean isSetMy_byte() {
    return EncodingUtils.testBit(__isset_bitfield, __MY_BYTE_ISSET_ID);
  }

  public void setMy_byteIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MY_BYTE_ISSET_ID, value);
  }

  public short getMy_16bit_int() {
    return this.my_16bit_int;
  }

  public void setMy_16bit_int(short my_16bit_int) {
    this.my_16bit_int = my_16bit_int;
    setMy_16bit_intIsSet(true);
  }

  public void unsetMy_16bit_int() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MY_16BIT_INT_ISSET_ID);
  }

  /** Returns true if field my_16bit_int is set (has been assigned a value) and false otherwise */
  public boolean isSetMy_16bit_int() {
    return EncodingUtils.testBit(__isset_bitfield, __MY_16BIT_INT_ISSET_ID);
  }

  public void setMy_16bit_intIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MY_16BIT_INT_ISSET_ID, value);
  }

  public int getMy_32bit_int() {
    return this.my_32bit_int;
  }

  public void setMy_32bit_int(int my_32bit_int) {
    this.my_32bit_int = my_32bit_int;
    setMy_32bit_intIsSet(true);
  }

  public void unsetMy_32bit_int() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MY_32BIT_INT_ISSET_ID);
  }

  /** Returns true if field my_32bit_int is set (has been assigned a value) and false otherwise */
  public boolean isSetMy_32bit_int() {
    return EncodingUtils.testBit(__isset_bitfield, __MY_32BIT_INT_ISSET_ID);
  }

  public void setMy_32bit_intIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MY_32BIT_INT_ISSET_ID, value);
  }

  public long getMy_64bit_int() {
    return this.my_64bit_int;
  }

  public void setMy_64bit_int(long my_64bit_int) {
    this.my_64bit_int = my_64bit_int;
    setMy_64bit_intIsSet(true);
  }

  public void unsetMy_64bit_int() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MY_64BIT_INT_ISSET_ID);
  }

  /** Returns true if field my_64bit_int is set (has been assigned a value) and false otherwise */
  public boolean isSetMy_64bit_int() {
    return EncodingUtils.testBit(__isset_bitfield, __MY_64BIT_INT_ISSET_ID);
  }

  public void setMy_64bit_intIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MY_64BIT_INT_ISSET_ID, value);
  }

  public double getMy_double() {
    return this.my_double;
  }

  public void setMy_double(double my_double) {
    this.my_double = my_double;
    setMy_doubleIsSet(true);
  }

  public void unsetMy_double() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MY_DOUBLE_ISSET_ID);
  }

  /** Returns true if field my_double is set (has been assigned a value) and false otherwise */
  public boolean isSetMy_double() {
    return EncodingUtils.testBit(__isset_bitfield, __MY_DOUBLE_ISSET_ID);
  }

  public void setMy_doubleIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MY_DOUBLE_ISSET_ID, value);
  }

  public String getMy_string() {
    return this.my_string;
  }

  public void setMy_string(String my_string) {
    this.my_string = my_string;
  }

  public void unsetMy_string() {
    this.my_string = null;
  }

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

  public void setMy_stringIsSet(boolean value) {
    if (!value) {
      this.my_string = null;
    }
  }

  public byte[] getMy_binary() {
    setMy_binary(org.apache.thrift.TBaseHelper.rightSize(my_binary));
    return my_binary == null ? null : my_binary.array();
  }

  public ByteBuffer bufferForMy_binary() {
    return org.apache.thrift.TBaseHelper.copyBinary(my_binary);
  }

  public void setMy_binary(byte[] my_binary) {
    this.my_binary = my_binary == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(my_binary, my_binary.length));
  }

  public void setMy_binary(ByteBuffer my_binary) {
    this.my_binary = org.apache.thrift.TBaseHelper.copyBinary(my_binary);
  }

  public void unsetMy_binary() {
    this.my_binary = null;
  }

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

  public void setMy_binaryIsSet(boolean value) {
    if (!value) {
      this.my_binary = null;
    }
  }

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

  public void putToMy_string_string_map(String key, String val) {
    if (this.my_string_string_map == null) {
      this.my_string_string_map = new HashMap();
    }
    this.my_string_string_map.put(key, val);
  }

  public Map getMy_string_string_map() {
    return this.my_string_string_map;
  }

  public void setMy_string_string_map(Map my_string_string_map) {
    this.my_string_string_map = my_string_string_map;
  }

  public void unsetMy_string_string_map() {
    this.my_string_string_map = null;
  }

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

  public void setMy_string_string_mapIsSet(boolean value) {
    if (!value) {
      this.my_string_string_map = null;
    }
  }

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

  public void putToMy_string_enum_map(String key, MyEnum val) {
    if (this.my_string_enum_map == null) {
      this.my_string_enum_map = new HashMap();
    }
    this.my_string_enum_map.put(key, val);
  }

  public Map getMy_string_enum_map() {
    return this.my_string_enum_map;
  }

  public void setMy_string_enum_map(Map my_string_enum_map) {
    this.my_string_enum_map = my_string_enum_map;
  }

  public void unsetMy_string_enum_map() {
    this.my_string_enum_map = null;
  }

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

  public void setMy_string_enum_mapIsSet(boolean value) {
    if (!value) {
      this.my_string_enum_map = null;
    }
  }

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

  public void putToMy_enum_string_map(MyEnum key, String val) {
    if (this.my_enum_string_map == null) {
      this.my_enum_string_map = new HashMap();
    }
    this.my_enum_string_map.put(key, val);
  }

  public Map getMy_enum_string_map() {
    return this.my_enum_string_map;
  }

  public void setMy_enum_string_map(Map my_enum_string_map) {
    this.my_enum_string_map = my_enum_string_map;
  }

  public void unsetMy_enum_string_map() {
    this.my_enum_string_map = null;
  }

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

  public void setMy_enum_string_mapIsSet(boolean value) {
    if (!value) {
      this.my_enum_string_map = null;
    }
  }

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

  public void putToMy_enum_struct_map(MyEnum key, MiniStruct val) {
    if (this.my_enum_struct_map == null) {
      this.my_enum_struct_map = new HashMap();
    }
    this.my_enum_struct_map.put(key, val);
  }

  public Map getMy_enum_struct_map() {
    return this.my_enum_struct_map;
  }

  public void setMy_enum_struct_map(Map my_enum_struct_map) {
    this.my_enum_struct_map = my_enum_struct_map;
  }

  public void unsetMy_enum_struct_map() {
    this.my_enum_struct_map = null;
  }

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

  public void setMy_enum_struct_mapIsSet(boolean value) {
    if (!value) {
      this.my_enum_struct_map = null;
    }
  }

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

  public void putToMy_enum_stringlist_map(MyEnum key, List val) {
    if (this.my_enum_stringlist_map == null) {
      this.my_enum_stringlist_map = new HashMap>();
    }
    this.my_enum_stringlist_map.put(key, val);
  }

  public Map> getMy_enum_stringlist_map() {
    return this.my_enum_stringlist_map;
  }

  public void setMy_enum_stringlist_map(Map> my_enum_stringlist_map) {
    this.my_enum_stringlist_map = my_enum_stringlist_map;
  }

  public void unsetMy_enum_stringlist_map() {
    this.my_enum_stringlist_map = null;
  }

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

  public void setMy_enum_stringlist_mapIsSet(boolean value) {
    if (!value) {
      this.my_enum_stringlist_map = null;
    }
  }

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

  public void putToMy_enum_structlist_map(MyEnum key, List val) {
    if (this.my_enum_structlist_map == null) {
      this.my_enum_structlist_map = new HashMap>();
    }
    this.my_enum_structlist_map.put(key, val);
  }

  public Map> getMy_enum_structlist_map() {
    return this.my_enum_structlist_map;
  }

  public void setMy_enum_structlist_map(Map> my_enum_structlist_map) {
    this.my_enum_structlist_map = my_enum_structlist_map;
  }

  public void unsetMy_enum_structlist_map() {
    this.my_enum_structlist_map = null;
  }

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

  public void setMy_enum_structlist_mapIsSet(boolean value) {
    if (!value) {
      this.my_enum_structlist_map = null;
    }
  }

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

  public java.util.Iterator getMy_stringlistIterator() {
    return (this.my_stringlist == null) ? null : this.my_stringlist.iterator();
  }

  public void addToMy_stringlist(String elem) {
    if (this.my_stringlist == null) {
      this.my_stringlist = new ArrayList();
    }
    this.my_stringlist.add(elem);
  }

  public List getMy_stringlist() {
    return this.my_stringlist;
  }

  public void setMy_stringlist(List my_stringlist) {
    this.my_stringlist = my_stringlist;
  }

  public void unsetMy_stringlist() {
    this.my_stringlist = null;
  }

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

  public void setMy_stringlistIsSet(boolean value) {
    if (!value) {
      this.my_stringlist = null;
    }
  }

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

  public java.util.Iterator getMy_structlistIterator() {
    return (this.my_structlist == null) ? null : this.my_structlist.iterator();
  }

  public void addToMy_structlist(MiniStruct elem) {
    if (this.my_structlist == null) {
      this.my_structlist = new ArrayList();
    }
    this.my_structlist.add(elem);
  }

  public List getMy_structlist() {
    return this.my_structlist;
  }

  public void setMy_structlist(List my_structlist) {
    this.my_structlist = my_structlist;
  }

  public void unsetMy_structlist() {
    this.my_structlist = null;
  }

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

  public void setMy_structlistIsSet(boolean value) {
    if (!value) {
      this.my_structlist = null;
    }
  }

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

  public java.util.Iterator getMy_enumlistIterator() {
    return (this.my_enumlist == null) ? null : this.my_enumlist.iterator();
  }

  public void addToMy_enumlist(MyEnum elem) {
    if (this.my_enumlist == null) {
      this.my_enumlist = new ArrayList();
    }
    this.my_enumlist.add(elem);
  }

  public List getMy_enumlist() {
    return this.my_enumlist;
  }

  public void setMy_enumlist(List my_enumlist) {
    this.my_enumlist = my_enumlist;
  }

  public void unsetMy_enumlist() {
    this.my_enumlist = null;
  }

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

  public void setMy_enumlistIsSet(boolean value) {
    if (!value) {
      this.my_enumlist = null;
    }
  }

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

  public java.util.Iterator getMy_stringsetIterator() {
    return (this.my_stringset == null) ? null : this.my_stringset.iterator();
  }

  public void addToMy_stringset(String elem) {
    if (this.my_stringset == null) {
      this.my_stringset = new HashSet();
    }
    this.my_stringset.add(elem);
  }

  public Set getMy_stringset() {
    return this.my_stringset;
  }

  public void setMy_stringset(Set my_stringset) {
    this.my_stringset = my_stringset;
  }

  public void unsetMy_stringset() {
    this.my_stringset = null;
  }

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

  public void setMy_stringsetIsSet(boolean value) {
    if (!value) {
      this.my_stringset = null;
    }
  }

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

  public java.util.Iterator getMy_enumsetIterator() {
    return (this.my_enumset == null) ? null : this.my_enumset.iterator();
  }

  public void addToMy_enumset(MyEnum elem) {
    if (this.my_enumset == null) {
      this.my_enumset = new HashSet();
    }
    this.my_enumset.add(elem);
  }

  public Set getMy_enumset() {
    return this.my_enumset;
  }

  public void setMy_enumset(Set my_enumset) {
    this.my_enumset = my_enumset;
  }

  public void unsetMy_enumset() {
    this.my_enumset = null;
  }

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

  public void setMy_enumsetIsSet(boolean value) {
    if (!value) {
      this.my_enumset = null;
    }
  }

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

  public java.util.Iterator getMy_structsetIterator() {
    return (this.my_structset == null) ? null : this.my_structset.iterator();
  }

  public void addToMy_structset(MiniStruct elem) {
    if (this.my_structset == null) {
      this.my_structset = new HashSet();
    }
    this.my_structset.add(elem);
  }

  public Set getMy_structset() {
    return this.my_structset;
  }

  public void setMy_structset(Set my_structset) {
    this.my_structset = my_structset;
  }

  public void unsetMy_structset() {
    this.my_structset = null;
  }

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

  public void setMy_structsetIsSet(boolean value) {
    if (!value) {
      this.my_structset = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case MY_BOOL:
      if (value == null) {
        unsetMy_bool();
      } else {
        setMy_bool((Boolean)value);
      }
      break;

    case MY_BYTE:
      if (value == null) {
        unsetMy_byte();
      } else {
        setMy_byte((Byte)value);
      }
      break;

    case MY_16BIT_INT:
      if (value == null) {
        unsetMy_16bit_int();
      } else {
        setMy_16bit_int((Short)value);
      }
      break;

    case MY_32BIT_INT:
      if (value == null) {
        unsetMy_32bit_int();
      } else {
        setMy_32bit_int((Integer)value);
      }
      break;

    case MY_64BIT_INT:
      if (value == null) {
        unsetMy_64bit_int();
      } else {
        setMy_64bit_int((Long)value);
      }
      break;

    case MY_DOUBLE:
      if (value == null) {
        unsetMy_double();
      } else {
        setMy_double((Double)value);
      }
      break;

    case MY_STRING:
      if (value == null) {
        unsetMy_string();
      } else {
        setMy_string((String)value);
      }
      break;

    case MY_BINARY:
      if (value == null) {
        unsetMy_binary();
      } else {
        setMy_binary((ByteBuffer)value);
      }
      break;

    case MY_STRING_STRING_MAP:
      if (value == null) {
        unsetMy_string_string_map();
      } else {
        setMy_string_string_map((Map)value);
      }
      break;

    case MY_STRING_ENUM_MAP:
      if (value == null) {
        unsetMy_string_enum_map();
      } else {
        setMy_string_enum_map((Map)value);
      }
      break;

    case MY_ENUM_STRING_MAP:
      if (value == null) {
        unsetMy_enum_string_map();
      } else {
        setMy_enum_string_map((Map)value);
      }
      break;

    case MY_ENUM_STRUCT_MAP:
      if (value == null) {
        unsetMy_enum_struct_map();
      } else {
        setMy_enum_struct_map((Map)value);
      }
      break;

    case MY_ENUM_STRINGLIST_MAP:
      if (value == null) {
        unsetMy_enum_stringlist_map();
      } else {
        setMy_enum_stringlist_map((Map>)value);
      }
      break;

    case MY_ENUM_STRUCTLIST_MAP:
      if (value == null) {
        unsetMy_enum_structlist_map();
      } else {
        setMy_enum_structlist_map((Map>)value);
      }
      break;

    case MY_STRINGLIST:
      if (value == null) {
        unsetMy_stringlist();
      } else {
        setMy_stringlist((List)value);
      }
      break;

    case MY_STRUCTLIST:
      if (value == null) {
        unsetMy_structlist();
      } else {
        setMy_structlist((List)value);
      }
      break;

    case MY_ENUMLIST:
      if (value == null) {
        unsetMy_enumlist();
      } else {
        setMy_enumlist((List)value);
      }
      break;

    case MY_STRINGSET:
      if (value == null) {
        unsetMy_stringset();
      } else {
        setMy_stringset((Set)value);
      }
      break;

    case MY_ENUMSET:
      if (value == null) {
        unsetMy_enumset();
      } else {
        setMy_enumset((Set)value);
      }
      break;

    case MY_STRUCTSET:
      if (value == null) {
        unsetMy_structset();
      } else {
        setMy_structset((Set)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case MY_BOOL:
      return isMy_bool();

    case MY_BYTE:
      return getMy_byte();

    case MY_16BIT_INT:
      return getMy_16bit_int();

    case MY_32BIT_INT:
      return getMy_32bit_int();

    case MY_64BIT_INT:
      return getMy_64bit_int();

    case MY_DOUBLE:
      return getMy_double();

    case MY_STRING:
      return getMy_string();

    case MY_BINARY:
      return getMy_binary();

    case MY_STRING_STRING_MAP:
      return getMy_string_string_map();

    case MY_STRING_ENUM_MAP:
      return getMy_string_enum_map();

    case MY_ENUM_STRING_MAP:
      return getMy_enum_string_map();

    case MY_ENUM_STRUCT_MAP:
      return getMy_enum_struct_map();

    case MY_ENUM_STRINGLIST_MAP:
      return getMy_enum_stringlist_map();

    case MY_ENUM_STRUCTLIST_MAP:
      return getMy_enum_structlist_map();

    case MY_STRINGLIST:
      return getMy_stringlist();

    case MY_STRUCTLIST:
      return getMy_structlist();

    case MY_ENUMLIST:
      return getMy_enumlist();

    case MY_STRINGSET:
      return getMy_stringset();

    case MY_ENUMSET:
      return getMy_enumset();

    case MY_STRUCTSET:
      return getMy_structset();

    }
    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 MY_BOOL:
      return isSetMy_bool();
    case MY_BYTE:
      return isSetMy_byte();
    case MY_16BIT_INT:
      return isSetMy_16bit_int();
    case MY_32BIT_INT:
      return isSetMy_32bit_int();
    case MY_64BIT_INT:
      return isSetMy_64bit_int();
    case MY_DOUBLE:
      return isSetMy_double();
    case MY_STRING:
      return isSetMy_string();
    case MY_BINARY:
      return isSetMy_binary();
    case MY_STRING_STRING_MAP:
      return isSetMy_string_string_map();
    case MY_STRING_ENUM_MAP:
      return isSetMy_string_enum_map();
    case MY_ENUM_STRING_MAP:
      return isSetMy_enum_string_map();
    case MY_ENUM_STRUCT_MAP:
      return isSetMy_enum_struct_map();
    case MY_ENUM_STRINGLIST_MAP:
      return isSetMy_enum_stringlist_map();
    case MY_ENUM_STRUCTLIST_MAP:
      return isSetMy_enum_structlist_map();
    case MY_STRINGLIST:
      return isSetMy_stringlist();
    case MY_STRUCTLIST:
      return isSetMy_structlist();
    case MY_ENUMLIST:
      return isSetMy_enumlist();
    case MY_STRINGSET:
      return isSetMy_stringset();
    case MY_ENUMSET:
      return isSetMy_enumset();
    case MY_STRUCTSET:
      return isSetMy_structset();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof MegaStruct)
      return this.equals((MegaStruct)that);
    return false;
  }

  public boolean equals(MegaStruct that) {
    if (that == null)
      return false;

    boolean this_present_my_bool = true && this.isSetMy_bool();
    boolean that_present_my_bool = true && that.isSetMy_bool();
    if (this_present_my_bool || that_present_my_bool) {
      if (!(this_present_my_bool && that_present_my_bool))
        return false;
      if (this.my_bool != that.my_bool)
        return false;
    }

    boolean this_present_my_byte = true && this.isSetMy_byte();
    boolean that_present_my_byte = true && that.isSetMy_byte();
    if (this_present_my_byte || that_present_my_byte) {
      if (!(this_present_my_byte && that_present_my_byte))
        return false;
      if (this.my_byte != that.my_byte)
        return false;
    }

    boolean this_present_my_16bit_int = true && this.isSetMy_16bit_int();
    boolean that_present_my_16bit_int = true && that.isSetMy_16bit_int();
    if (this_present_my_16bit_int || that_present_my_16bit_int) {
      if (!(this_present_my_16bit_int && that_present_my_16bit_int))
        return false;
      if (this.my_16bit_int != that.my_16bit_int)
        return false;
    }

    boolean this_present_my_32bit_int = true && this.isSetMy_32bit_int();
    boolean that_present_my_32bit_int = true && that.isSetMy_32bit_int();
    if (this_present_my_32bit_int || that_present_my_32bit_int) {
      if (!(this_present_my_32bit_int && that_present_my_32bit_int))
        return false;
      if (this.my_32bit_int != that.my_32bit_int)
        return false;
    }

    boolean this_present_my_64bit_int = true && this.isSetMy_64bit_int();
    boolean that_present_my_64bit_int = true && that.isSetMy_64bit_int();
    if (this_present_my_64bit_int || that_present_my_64bit_int) {
      if (!(this_present_my_64bit_int && that_present_my_64bit_int))
        return false;
      if (this.my_64bit_int != that.my_64bit_int)
        return false;
    }

    boolean this_present_my_double = true && this.isSetMy_double();
    boolean that_present_my_double = true && that.isSetMy_double();
    if (this_present_my_double || that_present_my_double) {
      if (!(this_present_my_double && that_present_my_double))
        return false;
      if (this.my_double != that.my_double)
        return false;
    }

    boolean this_present_my_string = true && this.isSetMy_string();
    boolean that_present_my_string = true && that.isSetMy_string();
    if (this_present_my_string || that_present_my_string) {
      if (!(this_present_my_string && that_present_my_string))
        return false;
      if (!this.my_string.equals(that.my_string))
        return false;
    }

    boolean this_present_my_binary = true && this.isSetMy_binary();
    boolean that_present_my_binary = true && that.isSetMy_binary();
    if (this_present_my_binary || that_present_my_binary) {
      if (!(this_present_my_binary && that_present_my_binary))
        return false;
      if (!this.my_binary.equals(that.my_binary))
        return false;
    }

    boolean this_present_my_string_string_map = true && this.isSetMy_string_string_map();
    boolean that_present_my_string_string_map = true && that.isSetMy_string_string_map();
    if (this_present_my_string_string_map || that_present_my_string_string_map) {
      if (!(this_present_my_string_string_map && that_present_my_string_string_map))
        return false;
      if (!this.my_string_string_map.equals(that.my_string_string_map))
        return false;
    }

    boolean this_present_my_string_enum_map = true && this.isSetMy_string_enum_map();
    boolean that_present_my_string_enum_map = true && that.isSetMy_string_enum_map();
    if (this_present_my_string_enum_map || that_present_my_string_enum_map) {
      if (!(this_present_my_string_enum_map && that_present_my_string_enum_map))
        return false;
      if (!this.my_string_enum_map.equals(that.my_string_enum_map))
        return false;
    }

    boolean this_present_my_enum_string_map = true && this.isSetMy_enum_string_map();
    boolean that_present_my_enum_string_map = true && that.isSetMy_enum_string_map();
    if (this_present_my_enum_string_map || that_present_my_enum_string_map) {
      if (!(this_present_my_enum_string_map && that_present_my_enum_string_map))
        return false;
      if (!this.my_enum_string_map.equals(that.my_enum_string_map))
        return false;
    }

    boolean this_present_my_enum_struct_map = true && this.isSetMy_enum_struct_map();
    boolean that_present_my_enum_struct_map = true && that.isSetMy_enum_struct_map();
    if (this_present_my_enum_struct_map || that_present_my_enum_struct_map) {
      if (!(this_present_my_enum_struct_map && that_present_my_enum_struct_map))
        return false;
      if (!this.my_enum_struct_map.equals(that.my_enum_struct_map))
        return false;
    }

    boolean this_present_my_enum_stringlist_map = true && this.isSetMy_enum_stringlist_map();
    boolean that_present_my_enum_stringlist_map = true && that.isSetMy_enum_stringlist_map();
    if (this_present_my_enum_stringlist_map || that_present_my_enum_stringlist_map) {
      if (!(this_present_my_enum_stringlist_map && that_present_my_enum_stringlist_map))
        return false;
      if (!this.my_enum_stringlist_map.equals(that.my_enum_stringlist_map))
        return false;
    }

    boolean this_present_my_enum_structlist_map = true && this.isSetMy_enum_structlist_map();
    boolean that_present_my_enum_structlist_map = true && that.isSetMy_enum_structlist_map();
    if (this_present_my_enum_structlist_map || that_present_my_enum_structlist_map) {
      if (!(this_present_my_enum_structlist_map && that_present_my_enum_structlist_map))
        return false;
      if (!this.my_enum_structlist_map.equals(that.my_enum_structlist_map))
        return false;
    }

    boolean this_present_my_stringlist = true && this.isSetMy_stringlist();
    boolean that_present_my_stringlist = true && that.isSetMy_stringlist();
    if (this_present_my_stringlist || that_present_my_stringlist) {
      if (!(this_present_my_stringlist && that_present_my_stringlist))
        return false;
      if (!this.my_stringlist.equals(that.my_stringlist))
        return false;
    }

    boolean this_present_my_structlist = true && this.isSetMy_structlist();
    boolean that_present_my_structlist = true && that.isSetMy_structlist();
    if (this_present_my_structlist || that_present_my_structlist) {
      if (!(this_present_my_structlist && that_present_my_structlist))
        return false;
      if (!this.my_structlist.equals(that.my_structlist))
        return false;
    }

    boolean this_present_my_enumlist = true && this.isSetMy_enumlist();
    boolean that_present_my_enumlist = true && that.isSetMy_enumlist();
    if (this_present_my_enumlist || that_present_my_enumlist) {
      if (!(this_present_my_enumlist && that_present_my_enumlist))
        return false;
      if (!this.my_enumlist.equals(that.my_enumlist))
        return false;
    }

    boolean this_present_my_stringset = true && this.isSetMy_stringset();
    boolean that_present_my_stringset = true && that.isSetMy_stringset();
    if (this_present_my_stringset || that_present_my_stringset) {
      if (!(this_present_my_stringset && that_present_my_stringset))
        return false;
      if (!this.my_stringset.equals(that.my_stringset))
        return false;
    }

    boolean this_present_my_enumset = true && this.isSetMy_enumset();
    boolean that_present_my_enumset = true && that.isSetMy_enumset();
    if (this_present_my_enumset || that_present_my_enumset) {
      if (!(this_present_my_enumset && that_present_my_enumset))
        return false;
      if (!this.my_enumset.equals(that.my_enumset))
        return false;
    }

    boolean this_present_my_structset = true && this.isSetMy_structset();
    boolean that_present_my_structset = true && that.isSetMy_structset();
    if (this_present_my_structset || that_present_my_structset) {
      if (!(this_present_my_structset && that_present_my_structset))
        return false;
      if (!this.my_structset.equals(that.my_structset))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_my_bool = true && (isSetMy_bool());
    list.add(present_my_bool);
    if (present_my_bool)
      list.add(my_bool);

    boolean present_my_byte = true && (isSetMy_byte());
    list.add(present_my_byte);
    if (present_my_byte)
      list.add(my_byte);

    boolean present_my_16bit_int = true && (isSetMy_16bit_int());
    list.add(present_my_16bit_int);
    if (present_my_16bit_int)
      list.add(my_16bit_int);

    boolean present_my_32bit_int = true && (isSetMy_32bit_int());
    list.add(present_my_32bit_int);
    if (present_my_32bit_int)
      list.add(my_32bit_int);

    boolean present_my_64bit_int = true && (isSetMy_64bit_int());
    list.add(present_my_64bit_int);
    if (present_my_64bit_int)
      list.add(my_64bit_int);

    boolean present_my_double = true && (isSetMy_double());
    list.add(present_my_double);
    if (present_my_double)
      list.add(my_double);

    boolean present_my_string = true && (isSetMy_string());
    list.add(present_my_string);
    if (present_my_string)
      list.add(my_string);

    boolean present_my_binary = true && (isSetMy_binary());
    list.add(present_my_binary);
    if (present_my_binary)
      list.add(my_binary);

    boolean present_my_string_string_map = true && (isSetMy_string_string_map());
    list.add(present_my_string_string_map);
    if (present_my_string_string_map)
      list.add(my_string_string_map);

    boolean present_my_string_enum_map = true && (isSetMy_string_enum_map());
    list.add(present_my_string_enum_map);
    if (present_my_string_enum_map)
      list.add(my_string_enum_map);

    boolean present_my_enum_string_map = true && (isSetMy_enum_string_map());
    list.add(present_my_enum_string_map);
    if (present_my_enum_string_map)
      list.add(my_enum_string_map);

    boolean present_my_enum_struct_map = true && (isSetMy_enum_struct_map());
    list.add(present_my_enum_struct_map);
    if (present_my_enum_struct_map)
      list.add(my_enum_struct_map);

    boolean present_my_enum_stringlist_map = true && (isSetMy_enum_stringlist_map());
    list.add(present_my_enum_stringlist_map);
    if (present_my_enum_stringlist_map)
      list.add(my_enum_stringlist_map);

    boolean present_my_enum_structlist_map = true && (isSetMy_enum_structlist_map());
    list.add(present_my_enum_structlist_map);
    if (present_my_enum_structlist_map)
      list.add(my_enum_structlist_map);

    boolean present_my_stringlist = true && (isSetMy_stringlist());
    list.add(present_my_stringlist);
    if (present_my_stringlist)
      list.add(my_stringlist);

    boolean present_my_structlist = true && (isSetMy_structlist());
    list.add(present_my_structlist);
    if (present_my_structlist)
      list.add(my_structlist);

    boolean present_my_enumlist = true && (isSetMy_enumlist());
    list.add(present_my_enumlist);
    if (present_my_enumlist)
      list.add(my_enumlist);

    boolean present_my_stringset = true && (isSetMy_stringset());
    list.add(present_my_stringset);
    if (present_my_stringset)
      list.add(my_stringset);

    boolean present_my_enumset = true && (isSetMy_enumset());
    list.add(present_my_enumset);
    if (present_my_enumset)
      list.add(my_enumset);

    boolean present_my_structset = true && (isSetMy_structset());
    list.add(present_my_structset);
    if (present_my_structset)
      list.add(my_structset);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetMy_bool()).compareTo(other.isSetMy_bool());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_bool()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_bool, other.my_bool);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_byte()).compareTo(other.isSetMy_byte());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_byte()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_byte, other.my_byte);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_16bit_int()).compareTo(other.isSetMy_16bit_int());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_16bit_int()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_16bit_int, other.my_16bit_int);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_32bit_int()).compareTo(other.isSetMy_32bit_int());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_32bit_int()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_32bit_int, other.my_32bit_int);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_64bit_int()).compareTo(other.isSetMy_64bit_int());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_64bit_int()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_64bit_int, other.my_64bit_int);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_double()).compareTo(other.isSetMy_double());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_double()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_double, other.my_double);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_string()).compareTo(other.isSetMy_string());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_string()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_string, other.my_string);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_binary()).compareTo(other.isSetMy_binary());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_binary()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_binary, other.my_binary);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_string_string_map()).compareTo(other.isSetMy_string_string_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_string_string_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_string_string_map, other.my_string_string_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_string_enum_map()).compareTo(other.isSetMy_string_enum_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_string_enum_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_string_enum_map, other.my_string_enum_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_enum_string_map()).compareTo(other.isSetMy_enum_string_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_string_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_string_map, other.my_enum_string_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_enum_struct_map()).compareTo(other.isSetMy_enum_struct_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_struct_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_struct_map, other.my_enum_struct_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_enum_stringlist_map()).compareTo(other.isSetMy_enum_stringlist_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_stringlist_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_stringlist_map, other.my_enum_stringlist_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_enum_structlist_map()).compareTo(other.isSetMy_enum_structlist_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_structlist_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_structlist_map, other.my_enum_structlist_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_stringlist()).compareTo(other.isSetMy_stringlist());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_stringlist()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_stringlist, other.my_stringlist);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_structlist()).compareTo(other.isSetMy_structlist());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_structlist()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_structlist, other.my_structlist);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_enumlist()).compareTo(other.isSetMy_enumlist());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enumlist()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enumlist, other.my_enumlist);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_stringset()).compareTo(other.isSetMy_stringset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_stringset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_stringset, other.my_stringset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_enumset()).compareTo(other.isSetMy_enumset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enumset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enumset, other.my_enumset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMy_structset()).compareTo(other.isSetMy_structset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_structset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_structset, other.my_structset);
      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("MegaStruct(");
    boolean first = true;

    if (isSetMy_bool()) {
      sb.append("my_bool:");
      sb.append(this.my_bool);
      first = false;
    }
    if (isSetMy_byte()) {
      if (!first) sb.append(", ");
      sb.append("my_byte:");
      sb.append(this.my_byte);
      first = false;
    }
    if (isSetMy_16bit_int()) {
      if (!first) sb.append(", ");
      sb.append("my_16bit_int:");
      sb.append(this.my_16bit_int);
      first = false;
    }
    if (isSetMy_32bit_int()) {
      if (!first) sb.append(", ");
      sb.append("my_32bit_int:");
      sb.append(this.my_32bit_int);
      first = false;
    }
    if (isSetMy_64bit_int()) {
      if (!first) sb.append(", ");
      sb.append("my_64bit_int:");
      sb.append(this.my_64bit_int);
      first = false;
    }
    if (isSetMy_double()) {
      if (!first) sb.append(", ");
      sb.append("my_double:");
      sb.append(this.my_double);
      first = false;
    }
    if (isSetMy_string()) {
      if (!first) sb.append(", ");
      sb.append("my_string:");
      if (this.my_string == null) {
        sb.append("null");
      } else {
        sb.append(this.my_string);
      }
      first = false;
    }
    if (isSetMy_binary()) {
      if (!first) sb.append(", ");
      sb.append("my_binary:");
      if (this.my_binary == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.my_binary, sb);
      }
      first = false;
    }
    if (isSetMy_string_string_map()) {
      if (!first) sb.append(", ");
      sb.append("my_string_string_map:");
      if (this.my_string_string_map == null) {
        sb.append("null");
      } else {
        sb.append(this.my_string_string_map);
      }
      first = false;
    }
    if (isSetMy_string_enum_map()) {
      if (!first) sb.append(", ");
      sb.append("my_string_enum_map:");
      if (this.my_string_enum_map == null) {
        sb.append("null");
      } else {
        sb.append(this.my_string_enum_map);
      }
      first = false;
    }
    if (isSetMy_enum_string_map()) {
      if (!first) sb.append(", ");
      sb.append("my_enum_string_map:");
      if (this.my_enum_string_map == null) {
        sb.append("null");
      } else {
        sb.append(this.my_enum_string_map);
      }
      first = false;
    }
    if (isSetMy_enum_struct_map()) {
      if (!first) sb.append(", ");
      sb.append("my_enum_struct_map:");
      if (this.my_enum_struct_map == null) {
        sb.append("null");
      } else {
        sb.append(this.my_enum_struct_map);
      }
      first = false;
    }
    if (isSetMy_enum_stringlist_map()) {
      if (!first) sb.append(", ");
      sb.append("my_enum_stringlist_map:");
      if (this.my_enum_stringlist_map == null) {
        sb.append("null");
      } else {
        sb.append(this.my_enum_stringlist_map);
      }
      first = false;
    }
    if (isSetMy_enum_structlist_map()) {
      if (!first) sb.append(", ");
      sb.append("my_enum_structlist_map:");
      if (this.my_enum_structlist_map == null) {
        sb.append("null");
      } else {
        sb.append(this.my_enum_structlist_map);
      }
      first = false;
    }
    if (isSetMy_stringlist()) {
      if (!first) sb.append(", ");
      sb.append("my_stringlist:");
      if (this.my_stringlist == null) {
        sb.append("null");
      } else {
        sb.append(this.my_stringlist);
      }
      first = false;
    }
    if (isSetMy_structlist()) {
      if (!first) sb.append(", ");
      sb.append("my_structlist:");
      if (this.my_structlist == null) {
        sb.append("null");
      } else {
        sb.append(this.my_structlist);
      }
      first = false;
    }
    if (isSetMy_enumlist()) {
      if (!first) sb.append(", ");
      sb.append("my_enumlist:");
      if (this.my_enumlist == null) {
        sb.append("null");
      } else {
        sb.append(this.my_enumlist);
      }
      first = false;
    }
    if (isSetMy_stringset()) {
      if (!first) sb.append(", ");
      sb.append("my_stringset:");
      if (this.my_stringset == null) {
        sb.append("null");
      } else {
        sb.append(this.my_stringset);
      }
      first = false;
    }
    if (isSetMy_enumset()) {
      if (!first) sb.append(", ");
      sb.append("my_enumset:");
      if (this.my_enumset == null) {
        sb.append("null");
      } else {
        sb.append(this.my_enumset);
      }
      first = false;
    }
    if (isSetMy_structset()) {
      if (!first) sb.append(", ");
      sb.append("my_structset:");
      if (this.my_structset == null) {
        sb.append("null");
      } else {
        sb.append(this.my_structset);
      }
      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, 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 MegaStructStandardSchemeFactory implements SchemeFactory {
    public MegaStructStandardScheme getScheme() {
      return new MegaStructStandardScheme();
    }
  }

  private static class MegaStructStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct 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: // MY_BOOL
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.my_bool = iprot.readBool();
              struct.setMy_boolIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // MY_BYTE
            if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
              struct.my_byte = iprot.readByte();
              struct.setMy_byteIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // MY_16BIT_INT
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.my_16bit_int = iprot.readI16();
              struct.setMy_16bit_intIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // MY_32BIT_INT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.my_32bit_int = iprot.readI32();
              struct.setMy_32bit_intIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // MY_64BIT_INT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.my_64bit_int = iprot.readI64();
              struct.setMy_64bit_intIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // MY_DOUBLE
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.my_double = iprot.readDouble();
              struct.setMy_doubleIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // MY_STRING
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.my_string = iprot.readString();
              struct.setMy_stringIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // MY_BINARY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.my_binary = iprot.readBinary();
              struct.setMy_binaryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // MY_STRING_STRING_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
                struct.my_string_string_map = new HashMap(2*_map0.size);
                String _key1;
                String _val2;
                for (int _i3 = 0; _i3 < _map0.size; ++_i3)
                {
                  _key1 = iprot.readString();
                  _val2 = iprot.readString();
                  struct.my_string_string_map.put(_key1, _val2);
                }
                iprot.readMapEnd();
              }
              struct.setMy_string_string_mapIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // MY_STRING_ENUM_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map4 = iprot.readMapBegin();
                struct.my_string_enum_map = new HashMap(2*_map4.size);
                String _key5;
                MyEnum _val6;
                for (int _i7 = 0; _i7 < _map4.size; ++_i7)
                {
                  _key5 = iprot.readString();
                  _val6 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
                  struct.my_string_enum_map.put(_key5, _val6);
                }
                iprot.readMapEnd();
              }
              struct.setMy_string_enum_mapIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // MY_ENUM_STRING_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
                struct.my_enum_string_map = new HashMap(2*_map8.size);
                MyEnum _key9;
                String _val10;
                for (int _i11 = 0; _i11 < _map8.size; ++_i11)
                {
                  _key9 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
                  _val10 = iprot.readString();
                  struct.my_enum_string_map.put(_key9, _val10);
                }
                iprot.readMapEnd();
              }
              struct.setMy_enum_string_mapIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // MY_ENUM_STRUCT_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map12 = iprot.readMapBegin();
                struct.my_enum_struct_map = new HashMap(2*_map12.size);
                MyEnum _key13;
                MiniStruct _val14;
                for (int _i15 = 0; _i15 < _map12.size; ++_i15)
                {
                  _key13 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
                  _val14 = new MiniStruct();
                  _val14.read(iprot);
                  struct.my_enum_struct_map.put(_key13, _val14);
                }
                iprot.readMapEnd();
              }
              struct.setMy_enum_struct_mapIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // MY_ENUM_STRINGLIST_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
                struct.my_enum_stringlist_map = new HashMap>(2*_map16.size);
                MyEnum _key17;
                List _val18;
                for (int _i19 = 0; _i19 < _map16.size; ++_i19)
                {
                  _key17 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
                  {
                    org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
                    _val18 = new ArrayList(_list20.size);
                    String _elem21;
                    for (int _i22 = 0; _i22 < _list20.size; ++_i22)
                    {
                      _elem21 = iprot.readString();
                      _val18.add(_elem21);
                    }
                    iprot.readListEnd();
                  }
                  struct.my_enum_stringlist_map.put(_key17, _val18);
                }
                iprot.readMapEnd();
              }
              struct.setMy_enum_stringlist_mapIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // MY_ENUM_STRUCTLIST_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map23 = iprot.readMapBegin();
                struct.my_enum_structlist_map = new HashMap>(2*_map23.size);
                MyEnum _key24;
                List _val25;
                for (int _i26 = 0; _i26 < _map23.size; ++_i26)
                {
                  _key24 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
                  {
                    org.apache.thrift.protocol.TList _list27 = iprot.readListBegin();
                    _val25 = new ArrayList(_list27.size);
                    MiniStruct _elem28;
                    for (int _i29 = 0; _i29 < _list27.size; ++_i29)
                    {
                      _elem28 = new MiniStruct();
                      _elem28.read(iprot);
                      _val25.add(_elem28);
                    }
                    iprot.readListEnd();
                  }
                  struct.my_enum_structlist_map.put(_key24, _val25);
                }
                iprot.readMapEnd();
              }
              struct.setMy_enum_structlist_mapIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 15: // MY_STRINGLIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
                struct.my_stringlist = new ArrayList(_list30.size);
                String _elem31;
                for (int _i32 = 0; _i32 < _list30.size; ++_i32)
                {
                  _elem31 = iprot.readString();
                  struct.my_stringlist.add(_elem31);
                }
                iprot.readListEnd();
              }
              struct.setMy_stringlistIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 16: // MY_STRUCTLIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list33 = iprot.readListBegin();
                struct.my_structlist = new ArrayList(_list33.size);
                MiniStruct _elem34;
                for (int _i35 = 0; _i35 < _list33.size; ++_i35)
                {
                  _elem34 = new MiniStruct();
                  _elem34.read(iprot);
                  struct.my_structlist.add(_elem34);
                }
                iprot.readListEnd();
              }
              struct.setMy_structlistIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 17: // MY_ENUMLIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list36 = iprot.readListBegin();
                struct.my_enumlist = new ArrayList(_list36.size);
                MyEnum _elem37;
                for (int _i38 = 0; _i38 < _list36.size; ++_i38)
                {
                  _elem37 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
                  struct.my_enumlist.add(_elem37);
                }
                iprot.readListEnd();
              }
              struct.setMy_enumlistIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 18: // MY_STRINGSET
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set39 = iprot.readSetBegin();
                struct.my_stringset = new HashSet(2*_set39.size);
                String _elem40;
                for (int _i41 = 0; _i41 < _set39.size; ++_i41)
                {
                  _elem40 = iprot.readString();
                  struct.my_stringset.add(_elem40);
                }
                iprot.readSetEnd();
              }
              struct.setMy_stringsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 19: // MY_ENUMSET
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set42 = iprot.readSetBegin();
                struct.my_enumset = new HashSet(2*_set42.size);
                MyEnum _elem43;
                for (int _i44 = 0; _i44 < _set42.size; ++_i44)
                {
                  _elem43 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
                  struct.my_enumset.add(_elem43);
                }
                iprot.readSetEnd();
              }
              struct.setMy_enumsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // MY_STRUCTSET
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set45 = iprot.readSetBegin();
                struct.my_structset = new HashSet(2*_set45.size);
                MiniStruct _elem46;
                for (int _i47 = 0; _i47 < _set45.size; ++_i47)
                {
                  _elem46 = new MiniStruct();
                  _elem46.read(iprot);
                  struct.my_structset.add(_elem46);
                }
                iprot.readSetEnd();
              }
              struct.setMy_structsetIsSet(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, MegaStruct struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetMy_bool()) {
        oprot.writeFieldBegin(MY_BOOL_FIELD_DESC);
        oprot.writeBool(struct.my_bool);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_byte()) {
        oprot.writeFieldBegin(MY_BYTE_FIELD_DESC);
        oprot.writeByte(struct.my_byte);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_16bit_int()) {
        oprot.writeFieldBegin(MY_16BIT_INT_FIELD_DESC);
        oprot.writeI16(struct.my_16bit_int);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_32bit_int()) {
        oprot.writeFieldBegin(MY_32BIT_INT_FIELD_DESC);
        oprot.writeI32(struct.my_32bit_int);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_64bit_int()) {
        oprot.writeFieldBegin(MY_64BIT_INT_FIELD_DESC);
        oprot.writeI64(struct.my_64bit_int);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_double()) {
        oprot.writeFieldBegin(MY_DOUBLE_FIELD_DESC);
        oprot.writeDouble(struct.my_double);
        oprot.writeFieldEnd();
      }
      if (struct.my_string != null) {
        if (struct.isSetMy_string()) {
          oprot.writeFieldBegin(MY_STRING_FIELD_DESC);
          oprot.writeString(struct.my_string);
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_binary != null) {
        if (struct.isSetMy_binary()) {
          oprot.writeFieldBegin(MY_BINARY_FIELD_DESC);
          oprot.writeBinary(struct.my_binary);
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_string_string_map != null) {
        if (struct.isSetMy_string_string_map()) {
          oprot.writeFieldBegin(MY_STRING_STRING_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.my_string_string_map.size()));
            for (Map.Entry _iter48 : struct.my_string_string_map.entrySet())
            {
              oprot.writeString(_iter48.getKey());
              oprot.writeString(_iter48.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_string_enum_map != null) {
        if (struct.isSetMy_string_enum_map()) {
          oprot.writeFieldBegin(MY_STRING_ENUM_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.my_string_enum_map.size()));
            for (Map.Entry _iter49 : struct.my_string_enum_map.entrySet())
            {
              oprot.writeString(_iter49.getKey());
              oprot.writeI32(_iter49.getValue().getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_string_map != null) {
        if (struct.isSetMy_enum_string_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRING_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, struct.my_enum_string_map.size()));
            for (Map.Entry _iter50 : struct.my_enum_string_map.entrySet())
            {
              oprot.writeI32(_iter50.getKey().getValue());
              oprot.writeString(_iter50.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_struct_map != null) {
        if (struct.isSetMy_enum_struct_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRUCT_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.my_enum_struct_map.size()));
            for (Map.Entry _iter51 : struct.my_enum_struct_map.entrySet())
            {
              oprot.writeI32(_iter51.getKey().getValue());
              _iter51.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_stringlist_map != null) {
        if (struct.isSetMy_enum_stringlist_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRINGLIST_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, struct.my_enum_stringlist_map.size()));
            for (Map.Entry> _iter52 : struct.my_enum_stringlist_map.entrySet())
            {
              oprot.writeI32(_iter52.getKey().getValue());
              {
                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter52.getValue().size()));
                for (String _iter53 : _iter52.getValue())
                {
                  oprot.writeString(_iter53);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_structlist_map != null) {
        if (struct.isSetMy_enum_structlist_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRUCTLIST_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, struct.my_enum_structlist_map.size()));
            for (Map.Entry> _iter54 : struct.my_enum_structlist_map.entrySet())
            {
              oprot.writeI32(_iter54.getKey().getValue());
              {
                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter54.getValue().size()));
                for (MiniStruct _iter55 : _iter54.getValue())
                {
                  _iter55.write(oprot);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_stringlist != null) {
        if (struct.isSetMy_stringlist()) {
          oprot.writeFieldBegin(MY_STRINGLIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.my_stringlist.size()));
            for (String _iter56 : struct.my_stringlist)
            {
              oprot.writeString(_iter56);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_structlist != null) {
        if (struct.isSetMy_structlist()) {
          oprot.writeFieldBegin(MY_STRUCTLIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.my_structlist.size()));
            for (MiniStruct _iter57 : struct.my_structlist)
            {
              _iter57.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enumlist != null) {
        if (struct.isSetMy_enumlist()) {
          oprot.writeFieldBegin(MY_ENUMLIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.my_enumlist.size()));
            for (MyEnum _iter58 : struct.my_enumlist)
            {
              oprot.writeI32(_iter58.getValue());
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_stringset != null) {
        if (struct.isSetMy_stringset()) {
          oprot.writeFieldBegin(MY_STRINGSET_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.my_stringset.size()));
            for (String _iter59 : struct.my_stringset)
            {
              oprot.writeString(_iter59);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enumset != null) {
        if (struct.isSetMy_enumset()) {
          oprot.writeFieldBegin(MY_ENUMSET_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.my_enumset.size()));
            for (MyEnum _iter60 : struct.my_enumset)
            {
              oprot.writeI32(_iter60.getValue());
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_structset != null) {
        if (struct.isSetMy_structset()) {
          oprot.writeFieldBegin(MY_STRUCTSET_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.my_structset.size()));
            for (MiniStruct _iter61 : struct.my_structset)
            {
              _iter61.write(oprot);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class MegaStructTupleSchemeFactory implements SchemeFactory {
    public MegaStructTupleScheme getScheme() {
      return new MegaStructTupleScheme();
    }
  }

  private static class MegaStructTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetMy_bool()) {
        optionals.set(0);
      }
      if (struct.isSetMy_byte()) {
        optionals.set(1);
      }
      if (struct.isSetMy_16bit_int()) {
        optionals.set(2);
      }
      if (struct.isSetMy_32bit_int()) {
        optionals.set(3);
      }
      if (struct.isSetMy_64bit_int()) {
        optionals.set(4);
      }
      if (struct.isSetMy_double()) {
        optionals.set(5);
      }
      if (struct.isSetMy_string()) {
        optionals.set(6);
      }
      if (struct.isSetMy_binary()) {
        optionals.set(7);
      }
      if (struct.isSetMy_string_string_map()) {
        optionals.set(8);
      }
      if (struct.isSetMy_string_enum_map()) {
        optionals.set(9);
      }
      if (struct.isSetMy_enum_string_map()) {
        optionals.set(10);
      }
      if (struct.isSetMy_enum_struct_map()) {
        optionals.set(11);
      }
      if (struct.isSetMy_enum_stringlist_map()) {
        optionals.set(12);
      }
      if (struct.isSetMy_enum_structlist_map()) {
        optionals.set(13);
      }
      if (struct.isSetMy_stringlist()) {
        optionals.set(14);
      }
      if (struct.isSetMy_structlist()) {
        optionals.set(15);
      }
      if (struct.isSetMy_enumlist()) {
        optionals.set(16);
      }
      if (struct.isSetMy_stringset()) {
        optionals.set(17);
      }
      if (struct.isSetMy_enumset()) {
        optionals.set(18);
      }
      if (struct.isSetMy_structset()) {
        optionals.set(19);
      }
      oprot.writeBitSet(optionals, 20);
      if (struct.isSetMy_bool()) {
        oprot.writeBool(struct.my_bool);
      }
      if (struct.isSetMy_byte()) {
        oprot.writeByte(struct.my_byte);
      }
      if (struct.isSetMy_16bit_int()) {
        oprot.writeI16(struct.my_16bit_int);
      }
      if (struct.isSetMy_32bit_int()) {
        oprot.writeI32(struct.my_32bit_int);
      }
      if (struct.isSetMy_64bit_int()) {
        oprot.writeI64(struct.my_64bit_int);
      }
      if (struct.isSetMy_double()) {
        oprot.writeDouble(struct.my_double);
      }
      if (struct.isSetMy_string()) {
        oprot.writeString(struct.my_string);
      }
      if (struct.isSetMy_binary()) {
        oprot.writeBinary(struct.my_binary);
      }
      if (struct.isSetMy_string_string_map()) {
        {
          oprot.writeI32(struct.my_string_string_map.size());
          for (Map.Entry _iter62 : struct.my_string_string_map.entrySet())
          {
            oprot.writeString(_iter62.getKey());
            oprot.writeString(_iter62.getValue());
          }
        }
      }
      if (struct.isSetMy_string_enum_map()) {
        {
          oprot.writeI32(struct.my_string_enum_map.size());
          for (Map.Entry _iter63 : struct.my_string_enum_map.entrySet())
          {
            oprot.writeString(_iter63.getKey());
            oprot.writeI32(_iter63.getValue().getValue());
          }
        }
      }
      if (struct.isSetMy_enum_string_map()) {
        {
          oprot.writeI32(struct.my_enum_string_map.size());
          for (Map.Entry _iter64 : struct.my_enum_string_map.entrySet())
          {
            oprot.writeI32(_iter64.getKey().getValue());
            oprot.writeString(_iter64.getValue());
          }
        }
      }
      if (struct.isSetMy_enum_struct_map()) {
        {
          oprot.writeI32(struct.my_enum_struct_map.size());
          for (Map.Entry _iter65 : struct.my_enum_struct_map.entrySet())
          {
            oprot.writeI32(_iter65.getKey().getValue());
            _iter65.getValue().write(oprot);
          }
        }
      }
      if (struct.isSetMy_enum_stringlist_map()) {
        {
          oprot.writeI32(struct.my_enum_stringlist_map.size());
          for (Map.Entry> _iter66 : struct.my_enum_stringlist_map.entrySet())
          {
            oprot.writeI32(_iter66.getKey().getValue());
            {
              oprot.writeI32(_iter66.getValue().size());
              for (String _iter67 : _iter66.getValue())
              {
                oprot.writeString(_iter67);
              }
            }
          }
        }
      }
      if (struct.isSetMy_enum_structlist_map()) {
        {
          oprot.writeI32(struct.my_enum_structlist_map.size());
          for (Map.Entry> _iter68 : struct.my_enum_structlist_map.entrySet())
          {
            oprot.writeI32(_iter68.getKey().getValue());
            {
              oprot.writeI32(_iter68.getValue().size());
              for (MiniStruct _iter69 : _iter68.getValue())
              {
                _iter69.write(oprot);
              }
            }
          }
        }
      }
      if (struct.isSetMy_stringlist()) {
        {
          oprot.writeI32(struct.my_stringlist.size());
          for (String _iter70 : struct.my_stringlist)
          {
            oprot.writeString(_iter70);
          }
        }
      }
      if (struct.isSetMy_structlist()) {
        {
          oprot.writeI32(struct.my_structlist.size());
          for (MiniStruct _iter71 : struct.my_structlist)
          {
            _iter71.write(oprot);
          }
        }
      }
      if (struct.isSetMy_enumlist()) {
        {
          oprot.writeI32(struct.my_enumlist.size());
          for (MyEnum _iter72 : struct.my_enumlist)
          {
            oprot.writeI32(_iter72.getValue());
          }
        }
      }
      if (struct.isSetMy_stringset()) {
        {
          oprot.writeI32(struct.my_stringset.size());
          for (String _iter73 : struct.my_stringset)
          {
            oprot.writeString(_iter73);
          }
        }
      }
      if (struct.isSetMy_enumset()) {
        {
          oprot.writeI32(struct.my_enumset.size());
          for (MyEnum _iter74 : struct.my_enumset)
          {
            oprot.writeI32(_iter74.getValue());
          }
        }
      }
      if (struct.isSetMy_structset()) {
        {
          oprot.writeI32(struct.my_structset.size());
          for (MiniStruct _iter75 : struct.my_structset)
          {
            _iter75.write(oprot);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(20);
      if (incoming.get(0)) {
        struct.my_bool = iprot.readBool();
        struct.setMy_boolIsSet(true);
      }
      if (incoming.get(1)) {
        struct.my_byte = iprot.readByte();
        struct.setMy_byteIsSet(true);
      }
      if (incoming.get(2)) {
        struct.my_16bit_int = iprot.readI16();
        struct.setMy_16bit_intIsSet(true);
      }
      if (incoming.get(3)) {
        struct.my_32bit_int = iprot.readI32();
        struct.setMy_32bit_intIsSet(true);
      }
      if (incoming.get(4)) {
        struct.my_64bit_int = iprot.readI64();
        struct.setMy_64bit_intIsSet(true);
      }
      if (incoming.get(5)) {
        struct.my_double = iprot.readDouble();
        struct.setMy_doubleIsSet(true);
      }
      if (incoming.get(6)) {
        struct.my_string = iprot.readString();
        struct.setMy_stringIsSet(true);
      }
      if (incoming.get(7)) {
        struct.my_binary = iprot.readBinary();
        struct.setMy_binaryIsSet(true);
      }
      if (incoming.get(8)) {
        {
          org.apache.thrift.protocol.TMap _map76 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.my_string_string_map = new HashMap(2*_map76.size);
          String _key77;
          String _val78;
          for (int _i79 = 0; _i79 < _map76.size; ++_i79)
          {
            _key77 = iprot.readString();
            _val78 = iprot.readString();
            struct.my_string_string_map.put(_key77, _val78);
          }
        }
        struct.setMy_string_string_mapIsSet(true);
      }
      if (incoming.get(9)) {
        {
          org.apache.thrift.protocol.TMap _map80 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.my_string_enum_map = new HashMap(2*_map80.size);
          String _key81;
          MyEnum _val82;
          for (int _i83 = 0; _i83 < _map80.size; ++_i83)
          {
            _key81 = iprot.readString();
            _val82 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
            struct.my_string_enum_map.put(_key81, _val82);
          }
        }
        struct.setMy_string_enum_mapIsSet(true);
      }
      if (incoming.get(10)) {
        {
          org.apache.thrift.protocol.TMap _map84 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.my_enum_string_map = new HashMap(2*_map84.size);
          MyEnum _key85;
          String _val86;
          for (int _i87 = 0; _i87 < _map84.size; ++_i87)
          {
            _key85 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
            _val86 = iprot.readString();
            struct.my_enum_string_map.put(_key85, _val86);
          }
        }
        struct.setMy_enum_string_mapIsSet(true);
      }
      if (incoming.get(11)) {
        {
          org.apache.thrift.protocol.TMap _map88 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.my_enum_struct_map = new HashMap(2*_map88.size);
          MyEnum _key89;
          MiniStruct _val90;
          for (int _i91 = 0; _i91 < _map88.size; ++_i91)
          {
            _key89 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
            _val90 = new MiniStruct();
            _val90.read(iprot);
            struct.my_enum_struct_map.put(_key89, _val90);
          }
        }
        struct.setMy_enum_struct_mapIsSet(true);
      }
      if (incoming.get(12)) {
        {
          org.apache.thrift.protocol.TMap _map92 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
          struct.my_enum_stringlist_map = new HashMap>(2*_map92.size);
          MyEnum _key93;
          List _val94;
          for (int _i95 = 0; _i95 < _map92.size; ++_i95)
          {
            _key93 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
            {
              org.apache.thrift.protocol.TList _list96 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
              _val94 = new ArrayList(_list96.size);
              String _elem97;
              for (int _i98 = 0; _i98 < _list96.size; ++_i98)
              {
                _elem97 = iprot.readString();
                _val94.add(_elem97);
              }
            }
            struct.my_enum_stringlist_map.put(_key93, _val94);
          }
        }
        struct.setMy_enum_stringlist_mapIsSet(true);
      }
      if (incoming.get(13)) {
        {
          org.apache.thrift.protocol.TMap _map99 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
          struct.my_enum_structlist_map = new HashMap>(2*_map99.size);
          MyEnum _key100;
          List _val101;
          for (int _i102 = 0; _i102 < _map99.size; ++_i102)
          {
            _key100 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
            {
              org.apache.thrift.protocol.TList _list103 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
              _val101 = new ArrayList(_list103.size);
              MiniStruct _elem104;
              for (int _i105 = 0; _i105 < _list103.size; ++_i105)
              {
                _elem104 = new MiniStruct();
                _elem104.read(iprot);
                _val101.add(_elem104);
              }
            }
            struct.my_enum_structlist_map.put(_key100, _val101);
          }
        }
        struct.setMy_enum_structlist_mapIsSet(true);
      }
      if (incoming.get(14)) {
        {
          org.apache.thrift.protocol.TList _list106 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.my_stringlist = new ArrayList(_list106.size);
          String _elem107;
          for (int _i108 = 0; _i108 < _list106.size; ++_i108)
          {
            _elem107 = iprot.readString();
            struct.my_stringlist.add(_elem107);
          }
        }
        struct.setMy_stringlistIsSet(true);
      }
      if (incoming.get(15)) {
        {
          org.apache.thrift.protocol.TList _list109 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.my_structlist = new ArrayList(_list109.size);
          MiniStruct _elem110;
          for (int _i111 = 0; _i111 < _list109.size; ++_i111)
          {
            _elem110 = new MiniStruct();
            _elem110.read(iprot);
            struct.my_structlist.add(_elem110);
          }
        }
        struct.setMy_structlistIsSet(true);
      }
      if (incoming.get(16)) {
        {
          org.apache.thrift.protocol.TList _list112 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.my_enumlist = new ArrayList(_list112.size);
          MyEnum _elem113;
          for (int _i114 = 0; _i114 < _list112.size; ++_i114)
          {
            _elem113 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
            struct.my_enumlist.add(_elem113);
          }
        }
        struct.setMy_enumlistIsSet(true);
      }
      if (incoming.get(17)) {
        {
          org.apache.thrift.protocol.TSet _set115 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.my_stringset = new HashSet(2*_set115.size);
          String _elem116;
          for (int _i117 = 0; _i117 < _set115.size; ++_i117)
          {
            _elem116 = iprot.readString();
            struct.my_stringset.add(_elem116);
          }
        }
        struct.setMy_stringsetIsSet(true);
      }
      if (incoming.get(18)) {
        {
          org.apache.thrift.protocol.TSet _set118 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.my_enumset = new HashSet(2*_set118.size);
          MyEnum _elem119;
          for (int _i120 = 0; _i120 < _set118.size; ++_i120)
          {
            _elem119 = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32());
            struct.my_enumset.add(_elem119);
          }
        }
        struct.setMy_enumsetIsSet(true);
      }
      if (incoming.get(19)) {
        {
          org.apache.thrift.protocol.TSet _set121 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.my_structset = new HashSet(2*_set121.size);
          MiniStruct _elem122;
          for (int _i123 = 0; _i123 < _set121.size; ++_i123)
          {
            _elem122 = new MiniStruct();
            _elem122.read(iprot);
            struct.my_structset.add(_elem122);
          }
        }
        struct.setMy_structsetIsSet(true);
      }
    }
  }

}