Example #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ErrorModel struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeString(struct.errorId);
   BitSet optionals = new BitSet();
   if (struct.isSetCreationTime()) {
     optionals.set(0);
   }
   if (struct.isSetActualErrorMessage()) {
     optionals.set(1);
   }
   if (struct.isSetUserFriendlyMessage()) {
     optionals.set(2);
   }
   if (struct.isSetTransientOrPersistent()) {
     optionals.set(3);
   }
   if (struct.isSetRootCauseErrorIdList()) {
     optionals.set(4);
   }
   oprot.writeBitSet(optionals, 5);
   if (struct.isSetCreationTime()) {
     oprot.writeI64(struct.creationTime);
   }
   if (struct.isSetActualErrorMessage()) {
     oprot.writeString(struct.actualErrorMessage);
   }
   if (struct.isSetUserFriendlyMessage()) {
     oprot.writeString(struct.userFriendlyMessage);
   }
   if (struct.isSetTransientOrPersistent()) {
     oprot.writeBool(struct.transientOrPersistent);
   }
   if (struct.isSetRootCauseErrorIdList()) {
     {
       oprot.writeI32(struct.rootCauseErrorIdList.size());
       for (String _iter4 : struct.rootCauseErrorIdList) {
         oprot.writeString(_iter4);
       }
     }
   }
 }
Example #2
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, ErrorModel struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.errorId != null) {
        oprot.writeFieldBegin(ERROR_ID_FIELD_DESC);
        oprot.writeString(struct.errorId);
        oprot.writeFieldEnd();
      }
      if (struct.isSetCreationTime()) {
        oprot.writeFieldBegin(CREATION_TIME_FIELD_DESC);
        oprot.writeI64(struct.creationTime);
        oprot.writeFieldEnd();
      }
      if (struct.actualErrorMessage != null) {
        if (struct.isSetActualErrorMessage()) {
          oprot.writeFieldBegin(ACTUAL_ERROR_MESSAGE_FIELD_DESC);
          oprot.writeString(struct.actualErrorMessage);
          oprot.writeFieldEnd();
        }
      }
      if (struct.userFriendlyMessage != null) {
        if (struct.isSetUserFriendlyMessage()) {
          oprot.writeFieldBegin(USER_FRIENDLY_MESSAGE_FIELD_DESC);
          oprot.writeString(struct.userFriendlyMessage);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetTransientOrPersistent()) {
        oprot.writeFieldBegin(TRANSIENT_OR_PERSISTENT_FIELD_DESC);
        oprot.writeBool(struct.transientOrPersistent);
        oprot.writeFieldEnd();
      }
      if (struct.rootCauseErrorIdList != null) {
        if (struct.isSetRootCauseErrorIdList()) {
          oprot.writeFieldBegin(ROOT_CAUSE_ERROR_ID_LIST_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.STRING, struct.rootCauseErrorIdList.size()));
            for (String _iter3 : struct.rootCauseErrorIdList) {
              oprot.writeString(_iter3);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Example #3
0
  public boolean equals(ErrorModel that) {
    if (that == null) return false;

    boolean this_present_errorId = true && this.isSetErrorId();
    boolean that_present_errorId = true && that.isSetErrorId();
    if (this_present_errorId || that_present_errorId) {
      if (!(this_present_errorId && that_present_errorId)) return false;
      if (!this.errorId.equals(that.errorId)) return false;
    }

    boolean this_present_creationTime = true && this.isSetCreationTime();
    boolean that_present_creationTime = true && that.isSetCreationTime();
    if (this_present_creationTime || that_present_creationTime) {
      if (!(this_present_creationTime && that_present_creationTime)) return false;
      if (this.creationTime != that.creationTime) return false;
    }

    boolean this_present_actualErrorMessage = true && this.isSetActualErrorMessage();
    boolean that_present_actualErrorMessage = true && that.isSetActualErrorMessage();
    if (this_present_actualErrorMessage || that_present_actualErrorMessage) {
      if (!(this_present_actualErrorMessage && that_present_actualErrorMessage)) return false;
      if (!this.actualErrorMessage.equals(that.actualErrorMessage)) return false;
    }

    boolean this_present_userFriendlyMessage = true && this.isSetUserFriendlyMessage();
    boolean that_present_userFriendlyMessage = true && that.isSetUserFriendlyMessage();
    if (this_present_userFriendlyMessage || that_present_userFriendlyMessage) {
      if (!(this_present_userFriendlyMessage && that_present_userFriendlyMessage)) return false;
      if (!this.userFriendlyMessage.equals(that.userFriendlyMessage)) return false;
    }

    boolean this_present_transientOrPersistent = true && this.isSetTransientOrPersistent();
    boolean that_present_transientOrPersistent = true && that.isSetTransientOrPersistent();
    if (this_present_transientOrPersistent || that_present_transientOrPersistent) {
      if (!(this_present_transientOrPersistent && that_present_transientOrPersistent)) return false;
      if (this.transientOrPersistent != that.transientOrPersistent) return false;
    }

    boolean this_present_rootCauseErrorIdList = true && this.isSetRootCauseErrorIdList();
    boolean that_present_rootCauseErrorIdList = true && that.isSetRootCauseErrorIdList();
    if (this_present_rootCauseErrorIdList || that_present_rootCauseErrorIdList) {
      if (!(this_present_rootCauseErrorIdList && that_present_rootCauseErrorIdList)) return false;
      if (!this.rootCauseErrorIdList.equals(that.rootCauseErrorIdList)) return false;
    }

    return true;
  }
Example #4
0
 /** Performs a deep copy on <i>other</i>. */
 public ErrorModel(ErrorModel other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetErrorId()) {
     this.errorId = other.errorId;
   }
   this.creationTime = other.creationTime;
   if (other.isSetActualErrorMessage()) {
     this.actualErrorMessage = other.actualErrorMessage;
   }
   if (other.isSetUserFriendlyMessage()) {
     this.userFriendlyMessage = other.userFriendlyMessage;
   }
   this.transientOrPersistent = other.transientOrPersistent;
   if (other.isSetRootCauseErrorIdList()) {
     List<String> __this__rootCauseErrorIdList = new ArrayList<String>(other.rootCauseErrorIdList);
     this.rootCauseErrorIdList = __this__rootCauseErrorIdList;
   }
 }
Example #5
0
  @Override
  public int compareTo(ErrorModel other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetErrorId()).compareTo(other.isSetErrorId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorId, other.errorId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreationTime()).compareTo(other.isSetCreationTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreationTime()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.creationTime, other.creationTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetActualErrorMessage()).compareTo(other.isSetActualErrorMessage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetActualErrorMessage()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.actualErrorMessage, other.actualErrorMessage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetUserFriendlyMessage()).compareTo(other.isSetUserFriendlyMessage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserFriendlyMessage()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.userFriendlyMessage, other.userFriendlyMessage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetTransientOrPersistent()).compareTo(other.isSetTransientOrPersistent());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTransientOrPersistent()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.transientOrPersistent, other.transientOrPersistent);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetRootCauseErrorIdList()).compareTo(other.isSetRootCauseErrorIdList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRootCauseErrorIdList()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.rootCauseErrorIdList, other.rootCauseErrorIdList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }