Example #1
0
  @Override
  public int compareTo(FSError other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetErrorMsg()).compareTo(other.isSetErrorMsg());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorMsg()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMsg, other.errorMsg);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Example #2
0
 /** Performs a deep copy on <i>other</i>. */
 public FSError(FSError other) {
   __isset_bitfield = other.__isset_bitfield;
   this.errorCode = other.errorCode;
   if (other.isSetErrorMsg()) {
     this.errorMsg = other.errorMsg;
   }
 }
Example #3
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, FSError struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetErrorCode()) {
     optionals.set(0);
   }
   if (struct.isSetErrorMsg()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetErrorCode()) {
     oprot.writeI32(struct.errorCode);
   }
   if (struct.isSetErrorMsg()) {
     oprot.writeString(struct.errorMsg);
   }
 }
Example #4
0
  public boolean equals(FSError that) {
    if (that == null) return false;

    boolean this_present_errorCode = true;
    boolean that_present_errorCode = true;
    if (this_present_errorCode || that_present_errorCode) {
      if (!(this_present_errorCode && that_present_errorCode)) return false;
      if (this.errorCode != that.errorCode) return false;
    }

    boolean this_present_errorMsg = true && this.isSetErrorMsg();
    boolean that_present_errorMsg = true && that.isSetErrorMsg();
    if (this_present_errorMsg || that_present_errorMsg) {
      if (!(this_present_errorMsg && that_present_errorMsg)) return false;
      if (!this.errorMsg.equals(that.errorMsg)) return false;
    }

    return true;
  }