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

    boolean this_present_score = true && this.isSetScore();
    boolean that_present_score = true && that.isSetScore();
    if (this_present_score || that_present_score) {
      if (!(this_present_score && that_present_score)) return false;
      if (!this.score.equals(that.score)) return false;
    }

    boolean this_present_isShot = true;
    boolean that_present_isShot = true;
    if (this_present_isShot || that_present_isShot) {
      if (!(this_present_isShot && that_present_isShot)) return false;
      if (this.isShot != that.isShot) return false;
    }

    boolean this_present_detail = true && this.isSetDetail();
    boolean that_present_detail = true && that.isSetDetail();
    if (this_present_detail || that_present_detail) {
      if (!(this_present_detail && that_present_detail)) return false;
      if (!this.detail.equals(that.detail)) return false;
    }

    return true;
  }
 /** Performs a deep copy on <i>other</i>. */
 public AchieveResult(AchieveResult other) {
   __isset_bit_vector.clear();
   __isset_bit_vector.or(other.__isset_bit_vector);
   if (other.isSetScore()) {
     this.score = other.score;
   }
   this.isShot = other.isShot;
   if (other.isSetDetail()) {
     this.detail = other.detail;
   }
 }
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, AchieveResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeI32(struct.score.getValue());
   oprot.writeBool(struct.isShot);
   BitSet optionals = new BitSet();
   if (struct.isSetDetail()) {
     optionals.set(0);
   }
   oprot.writeBitSet(optionals, 1);
   if (struct.isSetDetail()) {
     oprot.writeString(struct.detail);
   }
 }
    public void read(org.apache.thrift.protocol.TProtocol iprot, AchieveResult 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: // SCORE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.score = ResultScore.findByValue(iprot.readI32());
              struct.setScoreIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // IS_SHOT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.isShot = iprot.readBool();
              struct.setIsShotIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // DETAIL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.detail = iprot.readString();
              struct.setDetailIsSet(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
      if (!struct.isSetIsShot()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'isShot' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }
    public void write(org.apache.thrift.protocol.TProtocol oprot, AchieveResult struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.score != null) {
        oprot.writeFieldBegin(SCORE_FIELD_DESC);
        oprot.writeI32(struct.score.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(IS_SHOT_FIELD_DESC);
      oprot.writeBool(struct.isShot);
      oprot.writeFieldEnd();
      if (struct.detail != null) {
        if (struct.isSetDetail()) {
          oprot.writeFieldBegin(DETAIL_FIELD_DESC);
          oprot.writeString(struct.detail);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, AchieveResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.score = ResultScore.findByValue(iprot.readI32());
   struct.setScoreIsSet(true);
   struct.isShot = iprot.readBool();
   struct.setIsShotIsSet(true);
   BitSet incoming = iprot.readBitSet(1);
   if (incoming.get(0)) {
     struct.detail = iprot.readString();
     struct.setDetailIsSet(true);
   }
 }
  public int compareTo(AchieveResult other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    AchieveResult typedOther = (AchieveResult) other;

    lastComparison = Boolean.valueOf(isSetScore()).compareTo(typedOther.isSetScore());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScore()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.score, typedOther.score);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIsShot()).compareTo(typedOther.isSetIsShot());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIsShot()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isShot, typedOther.isShot);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDetail()).compareTo(typedOther.isSetDetail());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDetail()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.detail, typedOther.detail);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }