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

com.adgear.anoa.test.nested.NestedThrift Maven / Gradle / Ivy

There is a newer version: 3.1.2
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.adgear.anoa.test.nested;

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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class NestedThrift 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("NestedThrift");

  private static final org.apache.thrift.protocol.TField ENUM_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("enum_field", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField STRUCT_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("struct_field", org.apache.thrift.protocol.TType.STRUCT, (short)2);
  private static final org.apache.thrift.protocol.TField ENUM_LIST_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("enum_list_field", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField STRUCT_LIST_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("struct_list_field", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField ENUM_SET_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("enum_set_field", org.apache.thrift.protocol.TType.SET, (short)5);
  private static final org.apache.thrift.protocol.TField STRUCT_SET_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("struct_set_field", org.apache.thrift.protocol.TType.SET, (short)6);
  private static final org.apache.thrift.protocol.TField ENUM_MAP_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("enum_map_field", org.apache.thrift.protocol.TType.MAP, (short)7);
  private static final org.apache.thrift.protocol.TField STRUCT_MAP_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("struct_map_field", org.apache.thrift.protocol.TType.MAP, (short)8);
  private static final org.apache.thrift.protocol.TField FLOAT_LIST_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("float_list_field", org.apache.thrift.protocol.TType.LIST, (short)10);
  private static final org.apache.thrift.protocol.TField FLOAT_MAP_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("float_map_field", org.apache.thrift.protocol.TType.MAP, (short)11);
  private static final org.apache.thrift.protocol.TField VARIANT_FIELD_DESC = new org.apache.thrift.protocol.TField("variant", org.apache.thrift.protocol.TType.STRUCT, (short)12);

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

  /**
   * 
   * @see EnumThrift
   */
  public EnumThrift enum_field; // optional
  public BytesThrift struct_field; // optional
  public List enum_list_field; // optional
  public List struct_list_field; // optional
  public Set enum_set_field; // optional
  public Set struct_set_field; // optional
  public Map enum_map_field; // optional
  public Map struct_map_field; // optional
  public List float_list_field; // optional
  public Map float_map_field; // optional
  public VariantThrift variant; // 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 {
    /**
     * 
     * @see EnumThrift
     */
    ENUM_FIELD((short)1, "enum_field"),
    STRUCT_FIELD((short)2, "struct_field"),
    ENUM_LIST_FIELD((short)3, "enum_list_field"),
    STRUCT_LIST_FIELD((short)4, "struct_list_field"),
    ENUM_SET_FIELD((short)5, "enum_set_field"),
    STRUCT_SET_FIELD((short)6, "struct_set_field"),
    ENUM_MAP_FIELD((short)7, "enum_map_field"),
    STRUCT_MAP_FIELD((short)8, "struct_map_field"),
    FLOAT_LIST_FIELD((short)10, "float_list_field"),
    FLOAT_MAP_FIELD((short)11, "float_map_field"),
    VARIANT((short)12, "variant");

    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: // ENUM_FIELD
          return ENUM_FIELD;
        case 2: // STRUCT_FIELD
          return STRUCT_FIELD;
        case 3: // ENUM_LIST_FIELD
          return ENUM_LIST_FIELD;
        case 4: // STRUCT_LIST_FIELD
          return STRUCT_LIST_FIELD;
        case 5: // ENUM_SET_FIELD
          return ENUM_SET_FIELD;
        case 6: // STRUCT_SET_FIELD
          return STRUCT_SET_FIELD;
        case 7: // ENUM_MAP_FIELD
          return ENUM_MAP_FIELD;
        case 8: // STRUCT_MAP_FIELD
          return STRUCT_MAP_FIELD;
        case 10: // FLOAT_LIST_FIELD
          return FLOAT_LIST_FIELD;
        case 11: // FLOAT_MAP_FIELD
          return FLOAT_MAP_FIELD;
        case 12: // VARIANT
          return VARIANT;
        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 _Fields optionals[] = {_Fields.ENUM_FIELD,_Fields.STRUCT_FIELD,_Fields.ENUM_LIST_FIELD,_Fields.STRUCT_LIST_FIELD,_Fields.ENUM_SET_FIELD,_Fields.STRUCT_SET_FIELD,_Fields.ENUM_MAP_FIELD,_Fields.STRUCT_MAP_FIELD,_Fields.FLOAT_LIST_FIELD,_Fields.FLOAT_MAP_FIELD,_Fields.VARIANT};
  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.ENUM_FIELD, new org.apache.thrift.meta_data.FieldMetaData("enum_field", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EnumThrift.class)));
    tmpMap.put(_Fields.STRUCT_FIELD, new org.apache.thrift.meta_data.FieldMetaData("struct_field", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BytesThrift.class)));
    tmpMap.put(_Fields.ENUM_LIST_FIELD, new org.apache.thrift.meta_data.FieldMetaData("enum_list_field", 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, EnumThrift.class))));
    tmpMap.put(_Fields.STRUCT_LIST_FIELD, new org.apache.thrift.meta_data.FieldMetaData("struct_list_field", 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, BytesThrift.class))));
    tmpMap.put(_Fields.ENUM_SET_FIELD, new org.apache.thrift.meta_data.FieldMetaData("enum_set_field", 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, EnumThrift.class))));
    tmpMap.put(_Fields.STRUCT_SET_FIELD, new org.apache.thrift.meta_data.FieldMetaData("struct_set_field", 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, BytesThrift.class))));
    tmpMap.put(_Fields.ENUM_MAP_FIELD, new org.apache.thrift.meta_data.FieldMetaData("enum_map_field", 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, EnumThrift.class))));
    tmpMap.put(_Fields.STRUCT_MAP_FIELD, new org.apache.thrift.meta_data.FieldMetaData("struct_map_field", 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BytesThrift.class))));
    tmpMap.put(_Fields.FLOAT_LIST_FIELD, new org.apache.thrift.meta_data.FieldMetaData("float_list_field", 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.DOUBLE))));
    tmpMap.put(_Fields.FLOAT_MAP_FIELD, new org.apache.thrift.meta_data.FieldMetaData("float_map_field", 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.DOUBLE))));
    tmpMap.put(_Fields.VARIANT, new org.apache.thrift.meta_data.FieldMetaData("variant", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, VariantThrift.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NestedThrift.class, metaDataMap);
  }

  public NestedThrift() {
    this.enum_field = com.adgear.anoa.test.nested.EnumThrift.OFF;

  }

  /**
   * Performs a deep copy on other.
   */
  public NestedThrift(NestedThrift other) {
    if (other.isSetEnum_field()) {
      this.enum_field = other.enum_field;
    }
    if (other.isSetStruct_field()) {
      this.struct_field = new BytesThrift(other.struct_field);
    }
    if (other.isSetEnum_list_field()) {
      List __this__enum_list_field = new ArrayList(other.enum_list_field.size());
      for (EnumThrift other_element : other.enum_list_field) {
        __this__enum_list_field.add(other_element);
      }
      this.enum_list_field = __this__enum_list_field;
    }
    if (other.isSetStruct_list_field()) {
      List __this__struct_list_field = new ArrayList(other.struct_list_field.size());
      for (BytesThrift other_element : other.struct_list_field) {
        __this__struct_list_field.add(new BytesThrift(other_element));
      }
      this.struct_list_field = __this__struct_list_field;
    }
    if (other.isSetEnum_set_field()) {
      Set __this__enum_set_field = new HashSet(other.enum_set_field.size());
      for (EnumThrift other_element : other.enum_set_field) {
        __this__enum_set_field.add(other_element);
      }
      this.enum_set_field = __this__enum_set_field;
    }
    if (other.isSetStruct_set_field()) {
      Set __this__struct_set_field = new HashSet(other.struct_set_field.size());
      for (BytesThrift other_element : other.struct_set_field) {
        __this__struct_set_field.add(new BytesThrift(other_element));
      }
      this.struct_set_field = __this__struct_set_field;
    }
    if (other.isSetEnum_map_field()) {
      Map __this__enum_map_field = new HashMap(other.enum_map_field.size());
      for (Map.Entry other_element : other.enum_map_field.entrySet()) {

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

        String __this__enum_map_field_copy_key = other_element_key;

        EnumThrift __this__enum_map_field_copy_value = other_element_value;

        __this__enum_map_field.put(__this__enum_map_field_copy_key, __this__enum_map_field_copy_value);
      }
      this.enum_map_field = __this__enum_map_field;
    }
    if (other.isSetStruct_map_field()) {
      Map __this__struct_map_field = new HashMap(other.struct_map_field.size());
      for (Map.Entry other_element : other.struct_map_field.entrySet()) {

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

        String __this__struct_map_field_copy_key = other_element_key;

        BytesThrift __this__struct_map_field_copy_value = new BytesThrift(other_element_value);

        __this__struct_map_field.put(__this__struct_map_field_copy_key, __this__struct_map_field_copy_value);
      }
      this.struct_map_field = __this__struct_map_field;
    }
    if (other.isSetFloat_list_field()) {
      List __this__float_list_field = new ArrayList(other.float_list_field);
      this.float_list_field = __this__float_list_field;
    }
    if (other.isSetFloat_map_field()) {
      Map __this__float_map_field = new HashMap(other.float_map_field);
      this.float_map_field = __this__float_map_field;
    }
    if (other.isSetVariant()) {
      this.variant = new VariantThrift(other.variant);
    }
  }

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

  @Override
  public void clear() {
    this.enum_field = com.adgear.anoa.test.nested.EnumThrift.OFF;

    this.struct_field = null;
    this.enum_list_field = null;
    this.struct_list_field = null;
    this.enum_set_field = null;
    this.struct_set_field = null;
    this.enum_map_field = null;
    this.struct_map_field = null;
    this.float_list_field = null;
    this.float_map_field = null;
    this.variant = null;
  }

  /**
   * 
   * @see EnumThrift
   */
  public EnumThrift getEnum_field() {
    return this.enum_field;
  }

  /**
   * 
   * @see EnumThrift
   */
  public NestedThrift setEnum_field(EnumThrift enum_field) {
    this.enum_field = enum_field;
    return this;
  }

  public void unsetEnum_field() {
    this.enum_field = null;
  }

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

  public void setEnum_fieldIsSet(boolean value) {
    if (!value) {
      this.enum_field = null;
    }
  }

  public BytesThrift getStruct_field() {
    return this.struct_field;
  }

  public NestedThrift setStruct_field(BytesThrift struct_field) {
    this.struct_field = struct_field;
    return this;
  }

  public void unsetStruct_field() {
    this.struct_field = null;
  }

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

  public void setStruct_fieldIsSet(boolean value) {
    if (!value) {
      this.struct_field = null;
    }
  }

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

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

  public void addToEnum_list_field(EnumThrift elem) {
    if (this.enum_list_field == null) {
      this.enum_list_field = new ArrayList();
    }
    this.enum_list_field.add(elem);
  }

  public List getEnum_list_field() {
    return this.enum_list_field;
  }

  public NestedThrift setEnum_list_field(List enum_list_field) {
    this.enum_list_field = enum_list_field;
    return this;
  }

  public void unsetEnum_list_field() {
    this.enum_list_field = null;
  }

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

  public void setEnum_list_fieldIsSet(boolean value) {
    if (!value) {
      this.enum_list_field = null;
    }
  }

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

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

  public void addToStruct_list_field(BytesThrift elem) {
    if (this.struct_list_field == null) {
      this.struct_list_field = new ArrayList();
    }
    this.struct_list_field.add(elem);
  }

  public List getStruct_list_field() {
    return this.struct_list_field;
  }

  public NestedThrift setStruct_list_field(List struct_list_field) {
    this.struct_list_field = struct_list_field;
    return this;
  }

  public void unsetStruct_list_field() {
    this.struct_list_field = null;
  }

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

  public void setStruct_list_fieldIsSet(boolean value) {
    if (!value) {
      this.struct_list_field = null;
    }
  }

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

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

  public void addToEnum_set_field(EnumThrift elem) {
    if (this.enum_set_field == null) {
      this.enum_set_field = new HashSet();
    }
    this.enum_set_field.add(elem);
  }

  public Set getEnum_set_field() {
    return this.enum_set_field;
  }

  public NestedThrift setEnum_set_field(Set enum_set_field) {
    this.enum_set_field = enum_set_field;
    return this;
  }

  public void unsetEnum_set_field() {
    this.enum_set_field = null;
  }

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

  public void setEnum_set_fieldIsSet(boolean value) {
    if (!value) {
      this.enum_set_field = null;
    }
  }

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

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

  public void addToStruct_set_field(BytesThrift elem) {
    if (this.struct_set_field == null) {
      this.struct_set_field = new HashSet();
    }
    this.struct_set_field.add(elem);
  }

  public Set getStruct_set_field() {
    return this.struct_set_field;
  }

  public NestedThrift setStruct_set_field(Set struct_set_field) {
    this.struct_set_field = struct_set_field;
    return this;
  }

  public void unsetStruct_set_field() {
    this.struct_set_field = null;
  }

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

  public void setStruct_set_fieldIsSet(boolean value) {
    if (!value) {
      this.struct_set_field = null;
    }
  }

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

  public void putToEnum_map_field(String key, EnumThrift val) {
    if (this.enum_map_field == null) {
      this.enum_map_field = new HashMap();
    }
    this.enum_map_field.put(key, val);
  }

  public Map getEnum_map_field() {
    return this.enum_map_field;
  }

  public NestedThrift setEnum_map_field(Map enum_map_field) {
    this.enum_map_field = enum_map_field;
    return this;
  }

  public void unsetEnum_map_field() {
    this.enum_map_field = null;
  }

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

  public void setEnum_map_fieldIsSet(boolean value) {
    if (!value) {
      this.enum_map_field = null;
    }
  }

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

  public void putToStruct_map_field(String key, BytesThrift val) {
    if (this.struct_map_field == null) {
      this.struct_map_field = new HashMap();
    }
    this.struct_map_field.put(key, val);
  }

  public Map getStruct_map_field() {
    return this.struct_map_field;
  }

  public NestedThrift setStruct_map_field(Map struct_map_field) {
    this.struct_map_field = struct_map_field;
    return this;
  }

  public void unsetStruct_map_field() {
    this.struct_map_field = null;
  }

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

  public void setStruct_map_fieldIsSet(boolean value) {
    if (!value) {
      this.struct_map_field = null;
    }
  }

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

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

  public void addToFloat_list_field(double elem) {
    if (this.float_list_field == null) {
      this.float_list_field = new ArrayList();
    }
    this.float_list_field.add(elem);
  }

  public List getFloat_list_field() {
    return this.float_list_field;
  }

  public NestedThrift setFloat_list_field(List float_list_field) {
    this.float_list_field = float_list_field;
    return this;
  }

  public void unsetFloat_list_field() {
    this.float_list_field = null;
  }

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

  public void setFloat_list_fieldIsSet(boolean value) {
    if (!value) {
      this.float_list_field = null;
    }
  }

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

  public void putToFloat_map_field(String key, double val) {
    if (this.float_map_field == null) {
      this.float_map_field = new HashMap();
    }
    this.float_map_field.put(key, val);
  }

  public Map getFloat_map_field() {
    return this.float_map_field;
  }

  public NestedThrift setFloat_map_field(Map float_map_field) {
    this.float_map_field = float_map_field;
    return this;
  }

  public void unsetFloat_map_field() {
    this.float_map_field = null;
  }

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

  public void setFloat_map_fieldIsSet(boolean value) {
    if (!value) {
      this.float_map_field = null;
    }
  }

  public VariantThrift getVariant() {
    return this.variant;
  }

  public NestedThrift setVariant(VariantThrift variant) {
    this.variant = variant;
    return this;
  }

  public void unsetVariant() {
    this.variant = null;
  }

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

  public void setVariantIsSet(boolean value) {
    if (!value) {
      this.variant = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ENUM_FIELD:
      if (value == null) {
        unsetEnum_field();
      } else {
        setEnum_field((EnumThrift)value);
      }
      break;

    case STRUCT_FIELD:
      if (value == null) {
        unsetStruct_field();
      } else {
        setStruct_field((BytesThrift)value);
      }
      break;

    case ENUM_LIST_FIELD:
      if (value == null) {
        unsetEnum_list_field();
      } else {
        setEnum_list_field((List)value);
      }
      break;

    case STRUCT_LIST_FIELD:
      if (value == null) {
        unsetStruct_list_field();
      } else {
        setStruct_list_field((List)value);
      }
      break;

    case ENUM_SET_FIELD:
      if (value == null) {
        unsetEnum_set_field();
      } else {
        setEnum_set_field((Set)value);
      }
      break;

    case STRUCT_SET_FIELD:
      if (value == null) {
        unsetStruct_set_field();
      } else {
        setStruct_set_field((Set)value);
      }
      break;

    case ENUM_MAP_FIELD:
      if (value == null) {
        unsetEnum_map_field();
      } else {
        setEnum_map_field((Map)value);
      }
      break;

    case STRUCT_MAP_FIELD:
      if (value == null) {
        unsetStruct_map_field();
      } else {
        setStruct_map_field((Map)value);
      }
      break;

    case FLOAT_LIST_FIELD:
      if (value == null) {
        unsetFloat_list_field();
      } else {
        setFloat_list_field((List)value);
      }
      break;

    case FLOAT_MAP_FIELD:
      if (value == null) {
        unsetFloat_map_field();
      } else {
        setFloat_map_field((Map)value);
      }
      break;

    case VARIANT:
      if (value == null) {
        unsetVariant();
      } else {
        setVariant((VariantThrift)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ENUM_FIELD:
      return getEnum_field();

    case STRUCT_FIELD:
      return getStruct_field();

    case ENUM_LIST_FIELD:
      return getEnum_list_field();

    case STRUCT_LIST_FIELD:
      return getStruct_list_field();

    case ENUM_SET_FIELD:
      return getEnum_set_field();

    case STRUCT_SET_FIELD:
      return getStruct_set_field();

    case ENUM_MAP_FIELD:
      return getEnum_map_field();

    case STRUCT_MAP_FIELD:
      return getStruct_map_field();

    case FLOAT_LIST_FIELD:
      return getFloat_list_field();

    case FLOAT_MAP_FIELD:
      return getFloat_map_field();

    case VARIANT:
      return getVariant();

    }
    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 ENUM_FIELD:
      return isSetEnum_field();
    case STRUCT_FIELD:
      return isSetStruct_field();
    case ENUM_LIST_FIELD:
      return isSetEnum_list_field();
    case STRUCT_LIST_FIELD:
      return isSetStruct_list_field();
    case ENUM_SET_FIELD:
      return isSetEnum_set_field();
    case STRUCT_SET_FIELD:
      return isSetStruct_set_field();
    case ENUM_MAP_FIELD:
      return isSetEnum_map_field();
    case STRUCT_MAP_FIELD:
      return isSetStruct_map_field();
    case FLOAT_LIST_FIELD:
      return isSetFloat_list_field();
    case FLOAT_MAP_FIELD:
      return isSetFloat_map_field();
    case VARIANT:
      return isSetVariant();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_enum_field = true && this.isSetEnum_field();
    boolean that_present_enum_field = true && that.isSetEnum_field();
    if (this_present_enum_field || that_present_enum_field) {
      if (!(this_present_enum_field && that_present_enum_field))
        return false;
      if (!this.enum_field.equals(that.enum_field))
        return false;
    }

    boolean this_present_struct_field = true && this.isSetStruct_field();
    boolean that_present_struct_field = true && that.isSetStruct_field();
    if (this_present_struct_field || that_present_struct_field) {
      if (!(this_present_struct_field && that_present_struct_field))
        return false;
      if (!this.struct_field.equals(that.struct_field))
        return false;
    }

    boolean this_present_enum_list_field = true && this.isSetEnum_list_field();
    boolean that_present_enum_list_field = true && that.isSetEnum_list_field();
    if (this_present_enum_list_field || that_present_enum_list_field) {
      if (!(this_present_enum_list_field && that_present_enum_list_field))
        return false;
      if (!this.enum_list_field.equals(that.enum_list_field))
        return false;
    }

    boolean this_present_struct_list_field = true && this.isSetStruct_list_field();
    boolean that_present_struct_list_field = true && that.isSetStruct_list_field();
    if (this_present_struct_list_field || that_present_struct_list_field) {
      if (!(this_present_struct_list_field && that_present_struct_list_field))
        return false;
      if (!this.struct_list_field.equals(that.struct_list_field))
        return false;
    }

    boolean this_present_enum_set_field = true && this.isSetEnum_set_field();
    boolean that_present_enum_set_field = true && that.isSetEnum_set_field();
    if (this_present_enum_set_field || that_present_enum_set_field) {
      if (!(this_present_enum_set_field && that_present_enum_set_field))
        return false;
      if (!this.enum_set_field.equals(that.enum_set_field))
        return false;
    }

    boolean this_present_struct_set_field = true && this.isSetStruct_set_field();
    boolean that_present_struct_set_field = true && that.isSetStruct_set_field();
    if (this_present_struct_set_field || that_present_struct_set_field) {
      if (!(this_present_struct_set_field && that_present_struct_set_field))
        return false;
      if (!this.struct_set_field.equals(that.struct_set_field))
        return false;
    }

    boolean this_present_enum_map_field = true && this.isSetEnum_map_field();
    boolean that_present_enum_map_field = true && that.isSetEnum_map_field();
    if (this_present_enum_map_field || that_present_enum_map_field) {
      if (!(this_present_enum_map_field && that_present_enum_map_field))
        return false;
      if (!this.enum_map_field.equals(that.enum_map_field))
        return false;
    }

    boolean this_present_struct_map_field = true && this.isSetStruct_map_field();
    boolean that_present_struct_map_field = true && that.isSetStruct_map_field();
    if (this_present_struct_map_field || that_present_struct_map_field) {
      if (!(this_present_struct_map_field && that_present_struct_map_field))
        return false;
      if (!this.struct_map_field.equals(that.struct_map_field))
        return false;
    }

    boolean this_present_float_list_field = true && this.isSetFloat_list_field();
    boolean that_present_float_list_field = true && that.isSetFloat_list_field();
    if (this_present_float_list_field || that_present_float_list_field) {
      if (!(this_present_float_list_field && that_present_float_list_field))
        return false;
      if (!this.float_list_field.equals(that.float_list_field))
        return false;
    }

    boolean this_present_float_map_field = true && this.isSetFloat_map_field();
    boolean that_present_float_map_field = true && that.isSetFloat_map_field();
    if (this_present_float_map_field || that_present_float_map_field) {
      if (!(this_present_float_map_field && that_present_float_map_field))
        return false;
      if (!this.float_map_field.equals(that.float_map_field))
        return false;
    }

    boolean this_present_variant = true && this.isSetVariant();
    boolean that_present_variant = true && that.isSetVariant();
    if (this_present_variant || that_present_variant) {
      if (!(this_present_variant && that_present_variant))
        return false;
      if (!this.variant.equals(that.variant))
        return false;
    }

    return true;
  }

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

    boolean present_enum_field = true && (isSetEnum_field());
    list.add(present_enum_field);
    if (present_enum_field)
      list.add(enum_field.getValue());

    boolean present_struct_field = true && (isSetStruct_field());
    list.add(present_struct_field);
    if (present_struct_field)
      list.add(struct_field);

    boolean present_enum_list_field = true && (isSetEnum_list_field());
    list.add(present_enum_list_field);
    if (present_enum_list_field)
      list.add(enum_list_field);

    boolean present_struct_list_field = true && (isSetStruct_list_field());
    list.add(present_struct_list_field);
    if (present_struct_list_field)
      list.add(struct_list_field);

    boolean present_enum_set_field = true && (isSetEnum_set_field());
    list.add(present_enum_set_field);
    if (present_enum_set_field)
      list.add(enum_set_field);

    boolean present_struct_set_field = true && (isSetStruct_set_field());
    list.add(present_struct_set_field);
    if (present_struct_set_field)
      list.add(struct_set_field);

    boolean present_enum_map_field = true && (isSetEnum_map_field());
    list.add(present_enum_map_field);
    if (present_enum_map_field)
      list.add(enum_map_field);

    boolean present_struct_map_field = true && (isSetStruct_map_field());
    list.add(present_struct_map_field);
    if (present_struct_map_field)
      list.add(struct_map_field);

    boolean present_float_list_field = true && (isSetFloat_list_field());
    list.add(present_float_list_field);
    if (present_float_list_field)
      list.add(float_list_field);

    boolean present_float_map_field = true && (isSetFloat_map_field());
    list.add(present_float_map_field);
    if (present_float_map_field)
      list.add(float_map_field);

    boolean present_variant = true && (isSetVariant());
    list.add(present_variant);
    if (present_variant)
      list.add(variant);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetEnum_field()).compareTo(other.isSetEnum_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEnum_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enum_field, other.enum_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStruct_field()).compareTo(other.isSetStruct_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStruct_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.struct_field, other.struct_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEnum_list_field()).compareTo(other.isSetEnum_list_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEnum_list_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enum_list_field, other.enum_list_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStruct_list_field()).compareTo(other.isSetStruct_list_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStruct_list_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.struct_list_field, other.struct_list_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEnum_set_field()).compareTo(other.isSetEnum_set_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEnum_set_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enum_set_field, other.enum_set_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStruct_set_field()).compareTo(other.isSetStruct_set_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStruct_set_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.struct_set_field, other.struct_set_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEnum_map_field()).compareTo(other.isSetEnum_map_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEnum_map_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enum_map_field, other.enum_map_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStruct_map_field()).compareTo(other.isSetStruct_map_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStruct_map_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.struct_map_field, other.struct_map_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFloat_list_field()).compareTo(other.isSetFloat_list_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFloat_list_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.float_list_field, other.float_list_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFloat_map_field()).compareTo(other.isSetFloat_map_field());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFloat_map_field()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.float_map_field, other.float_map_field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetVariant()).compareTo(other.isSetVariant());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetVariant()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.variant, other.variant);
      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("NestedThrift(");
    boolean first = true;

    if (isSetEnum_field()) {
      sb.append("enum_field:");
      if (this.enum_field == null) {
        sb.append("null");
      } else {
        sb.append(this.enum_field);
      }
      first = false;
    }
    if (isSetStruct_field()) {
      if (!first) sb.append(", ");
      sb.append("struct_field:");
      if (this.struct_field == null) {
        sb.append("null");
      } else {
        sb.append(this.struct_field);
      }
      first = false;
    }
    if (isSetEnum_list_field()) {
      if (!first) sb.append(", ");
      sb.append("enum_list_field:");
      if (this.enum_list_field == null) {
        sb.append("null");
      } else {
        sb.append(this.enum_list_field);
      }
      first = false;
    }
    if (isSetStruct_list_field()) {
      if (!first) sb.append(", ");
      sb.append("struct_list_field:");
      if (this.struct_list_field == null) {
        sb.append("null");
      } else {
        sb.append(this.struct_list_field);
      }
      first = false;
    }
    if (isSetEnum_set_field()) {
      if (!first) sb.append(", ");
      sb.append("enum_set_field:");
      if (this.enum_set_field == null) {
        sb.append("null");
      } else {
        sb.append(this.enum_set_field);
      }
      first = false;
    }
    if (isSetStruct_set_field()) {
      if (!first) sb.append(", ");
      sb.append("struct_set_field:");
      if (this.struct_set_field == null) {
        sb.append("null");
      } else {
        sb.append(this.struct_set_field);
      }
      first = false;
    }
    if (isSetEnum_map_field()) {
      if (!first) sb.append(", ");
      sb.append("enum_map_field:");
      if (this.enum_map_field == null) {
        sb.append("null");
      } else {
        sb.append(this.enum_map_field);
      }
      first = false;
    }
    if (isSetStruct_map_field()) {
      if (!first) sb.append(", ");
      sb.append("struct_map_field:");
      if (this.struct_map_field == null) {
        sb.append("null");
      } else {
        sb.append(this.struct_map_field);
      }
      first = false;
    }
    if (isSetFloat_list_field()) {
      if (!first) sb.append(", ");
      sb.append("float_list_field:");
      if (this.float_list_field == null) {
        sb.append("null");
      } else {
        sb.append(this.float_list_field);
      }
      first = false;
    }
    if (isSetFloat_map_field()) {
      if (!first) sb.append(", ");
      sb.append("float_map_field:");
      if (this.float_map_field == null) {
        sb.append("null");
      } else {
        sb.append(this.float_map_field);
      }
      first = false;
    }
    if (isSetVariant()) {
      if (!first) sb.append(", ");
      sb.append("variant:");
      if (this.variant == null) {
        sb.append("null");
      } else {
        sb.append(this.variant);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (struct_field != null) {
      struct_field.validate();
    }
    if (variant != null) {
      variant.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class NestedThriftStandardSchemeFactory implements SchemeFactory {
    public NestedThriftStandardScheme getScheme() {
      return new NestedThriftStandardScheme();
    }
  }

  private static class NestedThriftStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, NestedThrift 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: // ENUM_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.enum_field = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
              struct.setEnum_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // STRUCT_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.struct_field = new BytesThrift();
              struct.struct_field.read(iprot);
              struct.setStruct_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // ENUM_LIST_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list18 = iprot.readListBegin();
                struct.enum_list_field = new ArrayList(_list18.size);
                EnumThrift _elem19;
                for (int _i20 = 0; _i20 < _list18.size; ++_i20)
                {
                  _elem19 = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
                  struct.enum_list_field.add(_elem19);
                }
                iprot.readListEnd();
              }
              struct.setEnum_list_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STRUCT_LIST_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
                struct.struct_list_field = new ArrayList(_list21.size);
                BytesThrift _elem22;
                for (int _i23 = 0; _i23 < _list21.size; ++_i23)
                {
                  _elem22 = new BytesThrift();
                  _elem22.read(iprot);
                  struct.struct_list_field.add(_elem22);
                }
                iprot.readListEnd();
              }
              struct.setStruct_list_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // ENUM_SET_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set24 = iprot.readSetBegin();
                struct.enum_set_field = new HashSet(2*_set24.size);
                EnumThrift _elem25;
                for (int _i26 = 0; _i26 < _set24.size; ++_i26)
                {
                  _elem25 = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
                  struct.enum_set_field.add(_elem25);
                }
                iprot.readSetEnd();
              }
              struct.setEnum_set_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // STRUCT_SET_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set27 = iprot.readSetBegin();
                struct.struct_set_field = new HashSet(2*_set27.size);
                BytesThrift _elem28;
                for (int _i29 = 0; _i29 < _set27.size; ++_i29)
                {
                  _elem28 = new BytesThrift();
                  _elem28.read(iprot);
                  struct.struct_set_field.add(_elem28);
                }
                iprot.readSetEnd();
              }
              struct.setStruct_set_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // ENUM_MAP_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map30 = iprot.readMapBegin();
                struct.enum_map_field = new HashMap(2*_map30.size);
                String _key31;
                EnumThrift _val32;
                for (int _i33 = 0; _i33 < _map30.size; ++_i33)
                {
                  _key31 = iprot.readString();
                  _val32 = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
                  struct.enum_map_field.put(_key31, _val32);
                }
                iprot.readMapEnd();
              }
              struct.setEnum_map_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // STRUCT_MAP_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map34 = iprot.readMapBegin();
                struct.struct_map_field = new HashMap(2*_map34.size);
                String _key35;
                BytesThrift _val36;
                for (int _i37 = 0; _i37 < _map34.size; ++_i37)
                {
                  _key35 = iprot.readString();
                  _val36 = new BytesThrift();
                  _val36.read(iprot);
                  struct.struct_map_field.put(_key35, _val36);
                }
                iprot.readMapEnd();
              }
              struct.setStruct_map_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // FLOAT_LIST_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
                struct.float_list_field = new ArrayList(_list38.size);
                double _elem39;
                for (int _i40 = 0; _i40 < _list38.size; ++_i40)
                {
                  _elem39 = iprot.readDouble();
                  struct.float_list_field.add(_elem39);
                }
                iprot.readListEnd();
              }
              struct.setFloat_list_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // FLOAT_MAP_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map41 = iprot.readMapBegin();
                struct.float_map_field = new HashMap(2*_map41.size);
                String _key42;
                double _val43;
                for (int _i44 = 0; _i44 < _map41.size; ++_i44)
                {
                  _key42 = iprot.readString();
                  _val43 = iprot.readDouble();
                  struct.float_map_field.put(_key42, _val43);
                }
                iprot.readMapEnd();
              }
              struct.setFloat_map_fieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // VARIANT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.variant = new VariantThrift();
              struct.variant.read(iprot);
              struct.setVariantIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.enum_field != null) {
        if (struct.isSetEnum_field()) {
          oprot.writeFieldBegin(ENUM_FIELD_FIELD_DESC);
          oprot.writeI32(struct.enum_field.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.struct_field != null) {
        if (struct.isSetStruct_field()) {
          oprot.writeFieldBegin(STRUCT_FIELD_FIELD_DESC);
          struct.struct_field.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.enum_list_field != null) {
        if (struct.isSetEnum_list_field()) {
          oprot.writeFieldBegin(ENUM_LIST_FIELD_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.enum_list_field.size()));
            for (EnumThrift _iter45 : struct.enum_list_field)
            {
              oprot.writeI32(_iter45.getValue());
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.struct_list_field != null) {
        if (struct.isSetStruct_list_field()) {
          oprot.writeFieldBegin(STRUCT_LIST_FIELD_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.struct_list_field.size()));
            for (BytesThrift _iter46 : struct.struct_list_field)
            {
              _iter46.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.enum_set_field != null) {
        if (struct.isSetEnum_set_field()) {
          oprot.writeFieldBegin(ENUM_SET_FIELD_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.enum_set_field.size()));
            for (EnumThrift _iter47 : struct.enum_set_field)
            {
              oprot.writeI32(_iter47.getValue());
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.struct_set_field != null) {
        if (struct.isSetStruct_set_field()) {
          oprot.writeFieldBegin(STRUCT_SET_FIELD_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.struct_set_field.size()));
            for (BytesThrift _iter48 : struct.struct_set_field)
            {
              _iter48.write(oprot);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.enum_map_field != null) {
        if (struct.isSetEnum_map_field()) {
          oprot.writeFieldBegin(ENUM_MAP_FIELD_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.enum_map_field.size()));
            for (Map.Entry _iter49 : struct.enum_map_field.entrySet())
            {
              oprot.writeString(_iter49.getKey());
              oprot.writeI32(_iter49.getValue().getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.struct_map_field != null) {
        if (struct.isSetStruct_map_field()) {
          oprot.writeFieldBegin(STRUCT_MAP_FIELD_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.struct_map_field.size()));
            for (Map.Entry _iter50 : struct.struct_map_field.entrySet())
            {
              oprot.writeString(_iter50.getKey());
              _iter50.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.float_list_field != null) {
        if (struct.isSetFloat_list_field()) {
          oprot.writeFieldBegin(FLOAT_LIST_FIELD_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, struct.float_list_field.size()));
            for (double _iter51 : struct.float_list_field)
            {
              oprot.writeDouble(_iter51);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.float_map_field != null) {
        if (struct.isSetFloat_map_field()) {
          oprot.writeFieldBegin(FLOAT_MAP_FIELD_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.float_map_field.size()));
            for (Map.Entry _iter52 : struct.float_map_field.entrySet())
            {
              oprot.writeString(_iter52.getKey());
              oprot.writeDouble(_iter52.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.variant != null) {
        if (struct.isSetVariant()) {
          oprot.writeFieldBegin(VARIANT_FIELD_DESC);
          struct.variant.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class NestedThriftTupleSchemeFactory implements SchemeFactory {
    public NestedThriftTupleScheme getScheme() {
      return new NestedThriftTupleScheme();
    }
  }

  private static class NestedThriftTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, NestedThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetEnum_field()) {
        optionals.set(0);
      }
      if (struct.isSetStruct_field()) {
        optionals.set(1);
      }
      if (struct.isSetEnum_list_field()) {
        optionals.set(2);
      }
      if (struct.isSetStruct_list_field()) {
        optionals.set(3);
      }
      if (struct.isSetEnum_set_field()) {
        optionals.set(4);
      }
      if (struct.isSetStruct_set_field()) {
        optionals.set(5);
      }
      if (struct.isSetEnum_map_field()) {
        optionals.set(6);
      }
      if (struct.isSetStruct_map_field()) {
        optionals.set(7);
      }
      if (struct.isSetFloat_list_field()) {
        optionals.set(8);
      }
      if (struct.isSetFloat_map_field()) {
        optionals.set(9);
      }
      if (struct.isSetVariant()) {
        optionals.set(10);
      }
      oprot.writeBitSet(optionals, 11);
      if (struct.isSetEnum_field()) {
        oprot.writeI32(struct.enum_field.getValue());
      }
      if (struct.isSetStruct_field()) {
        struct.struct_field.write(oprot);
      }
      if (struct.isSetEnum_list_field()) {
        {
          oprot.writeI32(struct.enum_list_field.size());
          for (EnumThrift _iter53 : struct.enum_list_field)
          {
            oprot.writeI32(_iter53.getValue());
          }
        }
      }
      if (struct.isSetStruct_list_field()) {
        {
          oprot.writeI32(struct.struct_list_field.size());
          for (BytesThrift _iter54 : struct.struct_list_field)
          {
            _iter54.write(oprot);
          }
        }
      }
      if (struct.isSetEnum_set_field()) {
        {
          oprot.writeI32(struct.enum_set_field.size());
          for (EnumThrift _iter55 : struct.enum_set_field)
          {
            oprot.writeI32(_iter55.getValue());
          }
        }
      }
      if (struct.isSetStruct_set_field()) {
        {
          oprot.writeI32(struct.struct_set_field.size());
          for (BytesThrift _iter56 : struct.struct_set_field)
          {
            _iter56.write(oprot);
          }
        }
      }
      if (struct.isSetEnum_map_field()) {
        {
          oprot.writeI32(struct.enum_map_field.size());
          for (Map.Entry _iter57 : struct.enum_map_field.entrySet())
          {
            oprot.writeString(_iter57.getKey());
            oprot.writeI32(_iter57.getValue().getValue());
          }
        }
      }
      if (struct.isSetStruct_map_field()) {
        {
          oprot.writeI32(struct.struct_map_field.size());
          for (Map.Entry _iter58 : struct.struct_map_field.entrySet())
          {
            oprot.writeString(_iter58.getKey());
            _iter58.getValue().write(oprot);
          }
        }
      }
      if (struct.isSetFloat_list_field()) {
        {
          oprot.writeI32(struct.float_list_field.size());
          for (double _iter59 : struct.float_list_field)
          {
            oprot.writeDouble(_iter59);
          }
        }
      }
      if (struct.isSetFloat_map_field()) {
        {
          oprot.writeI32(struct.float_map_field.size());
          for (Map.Entry _iter60 : struct.float_map_field.entrySet())
          {
            oprot.writeString(_iter60.getKey());
            oprot.writeDouble(_iter60.getValue());
          }
        }
      }
      if (struct.isSetVariant()) {
        struct.variant.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, NestedThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(11);
      if (incoming.get(0)) {
        struct.enum_field = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
        struct.setEnum_fieldIsSet(true);
      }
      if (incoming.get(1)) {
        struct.struct_field = new BytesThrift();
        struct.struct_field.read(iprot);
        struct.setStruct_fieldIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list61 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.enum_list_field = new ArrayList(_list61.size);
          EnumThrift _elem62;
          for (int _i63 = 0; _i63 < _list61.size; ++_i63)
          {
            _elem62 = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
            struct.enum_list_field.add(_elem62);
          }
        }
        struct.setEnum_list_fieldIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list64 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.struct_list_field = new ArrayList(_list64.size);
          BytesThrift _elem65;
          for (int _i66 = 0; _i66 < _list64.size; ++_i66)
          {
            _elem65 = new BytesThrift();
            _elem65.read(iprot);
            struct.struct_list_field.add(_elem65);
          }
        }
        struct.setStruct_list_fieldIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TSet _set67 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.enum_set_field = new HashSet(2*_set67.size);
          EnumThrift _elem68;
          for (int _i69 = 0; _i69 < _set67.size; ++_i69)
          {
            _elem68 = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
            struct.enum_set_field.add(_elem68);
          }
        }
        struct.setEnum_set_fieldIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TSet _set70 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.struct_set_field = new HashSet(2*_set70.size);
          BytesThrift _elem71;
          for (int _i72 = 0; _i72 < _set70.size; ++_i72)
          {
            _elem71 = new BytesThrift();
            _elem71.read(iprot);
            struct.struct_set_field.add(_elem71);
          }
        }
        struct.setStruct_set_fieldIsSet(true);
      }
      if (incoming.get(6)) {
        {
          org.apache.thrift.protocol.TMap _map73 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.enum_map_field = new HashMap(2*_map73.size);
          String _key74;
          EnumThrift _val75;
          for (int _i76 = 0; _i76 < _map73.size; ++_i76)
          {
            _key74 = iprot.readString();
            _val75 = com.adgear.anoa.test.nested.EnumThrift.findByValue(iprot.readI32());
            struct.enum_map_field.put(_key74, _val75);
          }
        }
        struct.setEnum_map_fieldIsSet(true);
      }
      if (incoming.get(7)) {
        {
          org.apache.thrift.protocol.TMap _map77 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.struct_map_field = new HashMap(2*_map77.size);
          String _key78;
          BytesThrift _val79;
          for (int _i80 = 0; _i80 < _map77.size; ++_i80)
          {
            _key78 = iprot.readString();
            _val79 = new BytesThrift();
            _val79.read(iprot);
            struct.struct_map_field.put(_key78, _val79);
          }
        }
        struct.setStruct_map_fieldIsSet(true);
      }
      if (incoming.get(8)) {
        {
          org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
          struct.float_list_field = new ArrayList(_list81.size);
          double _elem82;
          for (int _i83 = 0; _i83 < _list81.size; ++_i83)
          {
            _elem82 = iprot.readDouble();
            struct.float_list_field.add(_elem82);
          }
        }
        struct.setFloat_list_fieldIsSet(true);
      }
      if (incoming.get(9)) {
        {
          org.apache.thrift.protocol.TMap _map84 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
          struct.float_map_field = new HashMap(2*_map84.size);
          String _key85;
          double _val86;
          for (int _i87 = 0; _i87 < _map84.size; ++_i87)
          {
            _key85 = iprot.readString();
            _val86 = iprot.readDouble();
            struct.float_map_field.put(_key85, _val86);
          }
        }
        struct.setFloat_map_fieldIsSet(true);
      }
      if (incoming.get(10)) {
        struct.variant = new VariantThrift();
        struct.variant.read(iprot);
        struct.setVariantIsSet(true);
      }
    }
  }

}