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

everything.Spirfle Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
/**
 * Autogenerated by Thrift Compiler (1.0.0-dev)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package everything;

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", "unused"})
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2016-02-10")
public class Spirfle 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("Spirfle");

  private static final org.apache.thrift.protocol.TField GIFFLE_FIELD_DESC = new org.apache.thrift.protocol.TField("giffle", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField FLAR_FIELD_DESC = new org.apache.thrift.protocol.TField("flar", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField SPINKLE_FIELD_DESC = new org.apache.thrift.protocol.TField("spinkle", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField SPOOT_FIELD_DESC = new org.apache.thrift.protocol.TField("spoot", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField SPRAT_FIELD_DESC = new org.apache.thrift.protocol.TField("sprat", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField BLOTTO_FIELD_DESC = new org.apache.thrift.protocol.TField("blotto", org.apache.thrift.protocol.TType.STRUCT, (short)6);

  private static final SchemeFactory STANDARD_SCHEME_FACTORY = new SpirfleStandardSchemeFactory();
  private static final SchemeFactory TUPLE_SCHEME_FACTORY = new SpirfleTupleSchemeFactory();

  public String giffle; // required
  public int flar; // required
  /**
   * 
   * @see Spinkle
   */
  public Spinkle spinkle; // required
  public int spoot; // required
  public Sprat sprat; // required
  public another.Blotto blotto; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    GIFFLE((short)1, "giffle"),
    FLAR((short)2, "flar"),
    /**
     * 
     * @see Spinkle
     */
    SPINKLE((short)3, "spinkle"),
    SPOOT((short)4, "spoot"),
    SPRAT((short)5, "sprat"),
    BLOTTO((short)6, "blotto");

    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: // GIFFLE
          return GIFFLE;
        case 2: // FLAR
          return FLAR;
        case 3: // SPINKLE
          return SPINKLE;
        case 4: // SPOOT
          return SPOOT;
        case 5: // SPRAT
          return SPRAT;
        case 6: // BLOTTO
          return BLOTTO;
        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 __FLAR_ISSET_ID = 0;
  private static final int __SPOOT_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  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.GIFFLE, new org.apache.thrift.meta_data.FieldMetaData("giffle", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FLAR, new org.apache.thrift.meta_data.FieldMetaData("flar", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SPINKLE, new org.apache.thrift.meta_data.FieldMetaData("spinkle", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Spinkle.class)));
    tmpMap.put(_Fields.SPOOT, new org.apache.thrift.meta_data.FieldMetaData("spoot", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "dukk")));
    tmpMap.put(_Fields.SPRAT, new org.apache.thrift.meta_data.FieldMetaData("sprat", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "poig")));
    tmpMap.put(_Fields.BLOTTO, new org.apache.thrift.meta_data.FieldMetaData("blotto", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "hammlegaff")));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Spirfle.class, metaDataMap);
  }

  public Spirfle() {
  }

  public Spirfle(
    String giffle,
    int flar,
    Spinkle spinkle,
    int spoot,
    Sprat sprat,
    another.Blotto blotto)
  {
    this();
    this.giffle = giffle;
    this.flar = flar;
    setFlarIsSet(true);
    this.spinkle = spinkle;
    this.spoot = spoot;
    setSpootIsSet(true);
    this.sprat = sprat;
    this.blotto = blotto;
  }

  /**
   * Performs a deep copy on other.
   */
  public Spirfle(Spirfle other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetGiffle()) {
      this.giffle = other.giffle;
    }
    this.flar = other.flar;
    if (other.isSetSpinkle()) {
      this.spinkle = other.spinkle;
    }
    this.spoot = other.spoot;
    if (other.isSetSprat()) {
      this.sprat = other.sprat;
    }
    if (other.isSetBlotto()) {
      this.blotto = other.blotto;
    }
  }

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

  @Override
  public void clear() {
    this.giffle = null;
    setFlarIsSet(false);
    this.flar = 0;
    this.spinkle = null;
    setSpootIsSet(false);
    this.spoot = 0;
    this.sprat = null;
    this.blotto = null;
  }

  public String getGiffle() {
    return this.giffle;
  }

  public Spirfle setGiffle(String giffle) {
    this.giffle = giffle;
    return this;
  }

  public void unsetGiffle() {
    this.giffle = null;
  }

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

  public void setGiffleIsSet(boolean value) {
    if (!value) {
      this.giffle = null;
    }
  }

  public int getFlar() {
    return this.flar;
  }

  public Spirfle setFlar(int flar) {
    this.flar = flar;
    setFlarIsSet(true);
    return this;
  }

  public void unsetFlar() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FLAR_ISSET_ID);
  }

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

  public void setFlarIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FLAR_ISSET_ID, value);
  }

  /**
   * 
   * @see Spinkle
   */
  public Spinkle getSpinkle() {
    return this.spinkle;
  }

  /**
   * 
   * @see Spinkle
   */
  public Spirfle setSpinkle(Spinkle spinkle) {
    this.spinkle = spinkle;
    return this;
  }

  public void unsetSpinkle() {
    this.spinkle = null;
  }

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

  public void setSpinkleIsSet(boolean value) {
    if (!value) {
      this.spinkle = null;
    }
  }

  public int getSpoot() {
    return this.spoot;
  }

  public Spirfle setSpoot(int spoot) {
    this.spoot = spoot;
    setSpootIsSet(true);
    return this;
  }

  public void unsetSpoot() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SPOOT_ISSET_ID);
  }

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

  public void setSpootIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SPOOT_ISSET_ID, value);
  }

  public Sprat getSprat() {
    return this.sprat;
  }

  public Spirfle setSprat(Sprat sprat) {
    this.sprat = sprat;
    return this;
  }

  public void unsetSprat() {
    this.sprat = null;
  }

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

  public void setSpratIsSet(boolean value) {
    if (!value) {
      this.sprat = null;
    }
  }

  public another.Blotto getBlotto() {
    return this.blotto;
  }

  public Spirfle setBlotto(another.Blotto blotto) {
    this.blotto = blotto;
    return this;
  }

  public void unsetBlotto() {
    this.blotto = null;
  }

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

  public void setBlottoIsSet(boolean value) {
    if (!value) {
      this.blotto = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case GIFFLE:
      if (value == null) {
        unsetGiffle();
      } else {
        setGiffle((String)value);
      }
      break;

    case FLAR:
      if (value == null) {
        unsetFlar();
      } else {
        setFlar((Integer)value);
      }
      break;

    case SPINKLE:
      if (value == null) {
        unsetSpinkle();
      } else {
        setSpinkle((Spinkle)value);
      }
      break;

    case SPOOT:
      if (value == null) {
        unsetSpoot();
      } else {
        setSpoot((Integer)value);
      }
      break;

    case SPRAT:
      if (value == null) {
        unsetSprat();
      } else {
        setSprat((Sprat)value);
      }
      break;

    case BLOTTO:
      if (value == null) {
        unsetBlotto();
      } else {
        setBlotto((another.Blotto)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case GIFFLE:
      return getGiffle();

    case FLAR:
      return getFlar();

    case SPINKLE:
      return getSpinkle();

    case SPOOT:
      return getSpoot();

    case SPRAT:
      return getSprat();

    case BLOTTO:
      return getBlotto();

    }
    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 GIFFLE:
      return isSetGiffle();
    case FLAR:
      return isSetFlar();
    case SPINKLE:
      return isSetSpinkle();
    case SPOOT:
      return isSetSpoot();
    case SPRAT:
      return isSetSprat();
    case BLOTTO:
      return isSetBlotto();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_giffle = true && this.isSetGiffle();
    boolean that_present_giffle = true && that.isSetGiffle();
    if (this_present_giffle || that_present_giffle) {
      if (!(this_present_giffle && that_present_giffle))
        return false;
      if (!this.giffle.equals(that.giffle))
        return false;
    }

    boolean this_present_flar = true;
    boolean that_present_flar = true;
    if (this_present_flar || that_present_flar) {
      if (!(this_present_flar && that_present_flar))
        return false;
      if (this.flar != that.flar)
        return false;
    }

    boolean this_present_spinkle = true && this.isSetSpinkle();
    boolean that_present_spinkle = true && that.isSetSpinkle();
    if (this_present_spinkle || that_present_spinkle) {
      if (!(this_present_spinkle && that_present_spinkle))
        return false;
      if (!this.spinkle.equals(that.spinkle))
        return false;
    }

    boolean this_present_spoot = true;
    boolean that_present_spoot = true;
    if (this_present_spoot || that_present_spoot) {
      if (!(this_present_spoot && that_present_spoot))
        return false;
      if (this.spoot != that.spoot)
        return false;
    }

    boolean this_present_sprat = true && this.isSetSprat();
    boolean that_present_sprat = true && that.isSetSprat();
    if (this_present_sprat || that_present_sprat) {
      if (!(this_present_sprat && that_present_sprat))
        return false;
      if (!this.sprat.equals(that.sprat))
        return false;
    }

    boolean this_present_blotto = true && this.isSetBlotto();
    boolean that_present_blotto = true && that.isSetBlotto();
    if (this_present_blotto || that_present_blotto) {
      if (!(this_present_blotto && that_present_blotto))
        return false;
      if (!this.blotto.equals(that.blotto))
        return false;
    }

    return true;
  }

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

    boolean present_giffle = true && (isSetGiffle());
    list.add(present_giffle);
    if (present_giffle)
      list.add(giffle);

    boolean present_flar = true;
    list.add(present_flar);
    if (present_flar)
      list.add(flar);

    boolean present_spinkle = true && (isSetSpinkle());
    list.add(present_spinkle);
    if (present_spinkle)
      list.add(spinkle.getValue());

    boolean present_spoot = true;
    list.add(present_spoot);
    if (present_spoot)
      list.add(spoot);

    boolean present_sprat = true && (isSetSprat());
    list.add(present_sprat);
    if (present_sprat)
      list.add(sprat);

    boolean present_blotto = true && (isSetBlotto());
    list.add(present_blotto);
    if (present_blotto)
      list.add(blotto);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetGiffle()).compareTo(other.isSetGiffle());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGiffle()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.giffle, other.giffle);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFlar()).compareTo(other.isSetFlar());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFlar()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flar, other.flar);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSpinkle()).compareTo(other.isSetSpinkle());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSpinkle()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spinkle, other.spinkle);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSpoot()).compareTo(other.isSetSpoot());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSpoot()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spoot, other.spoot);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSprat()).compareTo(other.isSetSprat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSprat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sprat, other.sprat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBlotto()).compareTo(other.isSetBlotto());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBlotto()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blotto, other.blotto);
      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 {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("Spirfle(");
    boolean first = true;

    sb.append("giffle:");
    if (this.giffle == null) {
      sb.append("null");
    } else {
      sb.append(this.giffle);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("flar:");
    sb.append(this.flar);
    first = false;
    if (!first) sb.append(", ");
    sb.append("spinkle:");
    if (this.spinkle == null) {
      sb.append("null");
    } else {
      sb.append(this.spinkle);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("spoot:");
    sb.append(this.spoot);
    first = false;
    if (!first) sb.append(", ");
    sb.append("sprat:");
    if (this.sprat == null) {
      sb.append("null");
    } else {
      sb.append(this.sprat);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("blotto:");
    if (this.blotto == null) {
      sb.append("null");
    } else {
      sb.append(this.blotto);
    }
    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 SpirfleStandardSchemeFactory implements SchemeFactory {
    public SpirfleStandardScheme getScheme() {
      return new SpirfleStandardScheme();
    }
  }

  private static class SpirfleStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, Spirfle 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: // GIFFLE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.giffle = iprot.readString();
              struct.setGiffleIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FLAR
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.flar = iprot.readI32();
              struct.setFlarIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SPINKLE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.spinkle = everything.Spinkle.findByValue(iprot.readI32());
              struct.setSpinkleIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // SPOOT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.spoot = iprot.readI32();
              struct.setSpootIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // SPRAT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.sprat = new Sprat();
              struct.sprat.read(iprot);
              struct.setSpratIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // BLOTTO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.blotto = new another.Blotto();
              struct.blotto.read(iprot);
              struct.setBlottoIsSet(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, Spirfle struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.giffle != null) {
        oprot.writeFieldBegin(GIFFLE_FIELD_DESC);
        oprot.writeString(struct.giffle);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(FLAR_FIELD_DESC);
      oprot.writeI32(struct.flar);
      oprot.writeFieldEnd();
      if (struct.spinkle != null) {
        oprot.writeFieldBegin(SPINKLE_FIELD_DESC);
        oprot.writeI32(struct.spinkle.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(SPOOT_FIELD_DESC);
      oprot.writeI32(struct.spoot);
      oprot.writeFieldEnd();
      if (struct.sprat != null) {
        oprot.writeFieldBegin(SPRAT_FIELD_DESC);
        struct.sprat.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.blotto != null) {
        oprot.writeFieldBegin(BLOTTO_FIELD_DESC);
        struct.blotto.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class SpirfleTupleSchemeFactory implements SchemeFactory {
    public SpirfleTupleScheme getScheme() {
      return new SpirfleTupleScheme();
    }
  }

  private static class SpirfleTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Spirfle struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetGiffle()) {
        optionals.set(0);
      }
      if (struct.isSetFlar()) {
        optionals.set(1);
      }
      if (struct.isSetSpinkle()) {
        optionals.set(2);
      }
      if (struct.isSetSpoot()) {
        optionals.set(3);
      }
      if (struct.isSetSprat()) {
        optionals.set(4);
      }
      if (struct.isSetBlotto()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetGiffle()) {
        oprot.writeString(struct.giffle);
      }
      if (struct.isSetFlar()) {
        oprot.writeI32(struct.flar);
      }
      if (struct.isSetSpinkle()) {
        oprot.writeI32(struct.spinkle.getValue());
      }
      if (struct.isSetSpoot()) {
        oprot.writeI32(struct.spoot);
      }
      if (struct.isSetSprat()) {
        struct.sprat.write(oprot);
      }
      if (struct.isSetBlotto()) {
        struct.blotto.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Spirfle struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.giffle = iprot.readString();
        struct.setGiffleIsSet(true);
      }
      if (incoming.get(1)) {
        struct.flar = iprot.readI32();
        struct.setFlarIsSet(true);
      }
      if (incoming.get(2)) {
        struct.spinkle = everything.Spinkle.findByValue(iprot.readI32());
        struct.setSpinkleIsSet(true);
      }
      if (incoming.get(3)) {
        struct.spoot = iprot.readI32();
        struct.setSpootIsSet(true);
      }
      if (incoming.get(4)) {
        struct.sprat = new Sprat();
        struct.sprat.read(iprot);
        struct.setSpratIsSet(true);
      }
      if (incoming.get(5)) {
        struct.blotto = new another.Blotto();
        struct.blotto.read(iprot);
        struct.setBlottoIsSet(true);
      }
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}