Example #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, Result struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetValue()) {
     optionals.set(0);
   }
   if (struct.isSetError()) {
     optionals.set(1);
   }
   if (struct.isSetErrortext()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetValue()) {
     oprot.writeString(struct.value);
   }
   if (struct.isSetError()) {
     oprot.writeI32(struct.error.getValue());
   }
   if (struct.isSetErrortext()) {
     oprot.writeString(struct.errortext);
   }
 }
Example #2
0
  public boolean equals(Result that) {
    if (that == null) return false;

    boolean this_present_value = true && this.isSetValue();
    boolean that_present_value = true && that.isSetValue();
    if (this_present_value || that_present_value) {
      if (!(this_present_value && that_present_value)) return false;
      if (!this.value.equals(that.value)) return false;
    }

    boolean this_present_error = true && this.isSetError();
    boolean that_present_error = true && that.isSetError();
    if (this_present_error || that_present_error) {
      if (!(this_present_error && that_present_error)) return false;
      if (!this.error.equals(that.error)) return false;
    }

    boolean this_present_errortext = true && this.isSetErrortext();
    boolean that_present_errortext = true && that.isSetErrortext();
    if (this_present_errortext || that_present_errortext) {
      if (!(this_present_errortext && that_present_errortext)) return false;
      if (!this.errortext.equals(that.errortext)) return false;
    }

    return true;
  }
Example #3
0
 /** Performs a deep copy on <i>other</i>. */
 public Result(Result other) {
   if (other.isSetValue()) {
     this.value = other.value;
   }
   if (other.isSetError()) {
     this.error = other.error;
   }
   if (other.isSetErrortext()) {
     this.errortext = other.errortext;
   }
 }
Example #4
0
  @Override
  public int compareTo(Result other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValue()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetError()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetErrortext()).compareTo(other.isSetErrortext());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrortext()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errortext, other.errortext);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }