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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetWhatOp()).compareTo(other.isSetWhatOp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWhatOp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.whatOp, other.whatOp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWhy()).compareTo(other.isSetWhy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWhy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.why, other.why);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
 public void read(org.apache.thrift.protocol.TProtocol prot, InvalidOperation struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.whatOp = iprot.readI32();
     struct.setWhatOpIsSet(true);
   }
   if (incoming.get(1)) {
     struct.why = iprot.readString();
     struct.setWhyIsSet(true);
   }
 }
 /** Performs a deep copy on <i>other</i>. */
 public InvalidOperation(InvalidOperation other) {
   __isset_bitfield = other.__isset_bitfield;
   this.whatOp = other.whatOp;
   if (other.isSetWhy()) {
     this.why = other.why;
   }
 }
 public void write(org.apache.thrift.protocol.TProtocol prot, InvalidOperation struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetWhatOp()) {
     optionals.set(0);
   }
   if (struct.isSetWhy()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetWhatOp()) {
     oprot.writeI32(struct.whatOp);
   }
   if (struct.isSetWhy()) {
     oprot.writeString(struct.why);
   }
 }
    public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidOperation 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: // WHAT_OP
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.whatOp = iprot.readI32();
              struct.setWhatOpIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // WHY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.why = iprot.readString();
              struct.setWhyIsSet(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, InvalidOperation struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WHAT_OP_FIELD_DESC);
      oprot.writeI32(struct.whatOp);
      oprot.writeFieldEnd();
      if (struct.why != null) {
        oprot.writeFieldBegin(WHY_FIELD_DESC);
        oprot.writeString(struct.why);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
  public boolean equals(InvalidOperation that) {
    if (that == null) return false;

    boolean this_present_whatOp = true;
    boolean that_present_whatOp = true;
    if (this_present_whatOp || that_present_whatOp) {
      if (!(this_present_whatOp && that_present_whatOp)) return false;
      if (this.whatOp != that.whatOp) return false;
    }

    boolean this_present_why = true && this.isSetWhy();
    boolean that_present_why = true && that.isSetWhy();
    if (this_present_why || that_present_why) {
      if (!(this_present_why && that_present_why)) return false;
      if (!this.why.equals(that.why)) return false;
    }

    return true;
  }