Example #1
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 #2
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 #3
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 #4
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 #5
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, ErrorModel 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: // ERROR_ID
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.errorId = iprot.readString();
           struct.setErrorIdIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // CREATION_TIME
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.creationTime = iprot.readI64();
           struct.setCreationTimeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // ACTUAL_ERROR_MESSAGE
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.actualErrorMessage = iprot.readString();
           struct.setActualErrorMessageIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // USER_FRIENDLY_MESSAGE
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.userFriendlyMessage = iprot.readString();
           struct.setUserFriendlyMessageIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // TRANSIENT_OR_PERSISTENT
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.transientOrPersistent = iprot.readBool();
           struct.setTransientOrPersistentIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 6: // ROOT_CAUSE_ERROR_ID_LIST
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
             struct.rootCauseErrorIdList = new ArrayList<String>(_list0.size);
             String _elem1;
             for (int _i2 = 0; _i2 < _list0.size; ++_i2) {
               _elem1 = iprot.readString();
               struct.rootCauseErrorIdList.add(_elem1);
             }
             iprot.readListEnd();
           }
           struct.setRootCauseErrorIdListIsSet(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();
   struct.validate();
 }
Example #6
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;
  }
Example #7
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, ErrorModel struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.errorId = iprot.readString();
   struct.setErrorIdIsSet(true);
   BitSet incoming = iprot.readBitSet(5);
   if (incoming.get(0)) {
     struct.creationTime = iprot.readI64();
     struct.setCreationTimeIsSet(true);
   }
   if (incoming.get(1)) {
     struct.actualErrorMessage = iprot.readString();
     struct.setActualErrorMessageIsSet(true);
   }
   if (incoming.get(2)) {
     struct.userFriendlyMessage = iprot.readString();
     struct.setUserFriendlyMessageIsSet(true);
   }
   if (incoming.get(3)) {
     struct.transientOrPersistent = iprot.readBool();
     struct.setTransientOrPersistentIsSet(true);
   }
   if (incoming.get(4)) {
     {
       org.apache.thrift.protocol.TList _list5 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRING, iprot.readI32());
       struct.rootCauseErrorIdList = new ArrayList<String>(_list5.size);
       String _elem6;
       for (int _i7 = 0; _i7 < _list5.size; ++_i7) {
         _elem6 = iprot.readString();
         struct.rootCauseErrorIdList.add(_elem6);
       }
     }
     struct.setRootCauseErrorIdListIsSet(true);
   }
 }