示例#1
0
 /**
  * Check whether this error object equals to the other error object. The objects are equal if all
  * their respective fields are equal.
  *
  * @param thatErrorObject another error object
  * @return <b>true</b> if the objects are equal, <b>false</b> otherwise
  */
 public boolean equals(ErrorObject thatErrorObject) {
   if (m_id != thatErrorObject.m_id) {
     if ((m_id == null) || (thatErrorObject.m_id == null)) {
       return false;
     }
     if (!m_id.equals(thatErrorObject.m_id)) {
       return false;
     }
   }
   if (m_severity != thatErrorObject.m_severity) {
     if ((m_severity == null) || (thatErrorObject.m_severity == null)) {
       return false;
     }
     if (!m_severity.equals(thatErrorObject.m_severity)) {
       return false;
     }
   }
   if (m_parameters != thatErrorObject.m_parameters) {
     if ((m_parameters == null) || (thatErrorObject.m_parameters == null)) {
       return false;
     }
     if (!m_parameters.equals(thatErrorObject.m_parameters)) {
       return false;
     }
   }
   if (m_correlations != thatErrorObject.m_correlations) {
     if ((m_correlations == null) || (thatErrorObject.m_correlations == null)) {
       return false;
     }
     if (!m_correlations.equals(thatErrorObject.m_correlations)) {
       return false;
     }
   }
   return true;
 }
示例#2
0
  /**
   * Overrides Object.hashCode()
   *
   * @return hash code
   */
  public int hashCode() {
    int hash = 0;

    /*
     * We assume that id and severity
     * are non-null.
     * If they are null, then the class invariant is violated and
     * the NullPointerException will be rightfully thrown.
     */
    hash ^= m_id.hashCode();
    hash ^= m_severity.hashCode();

    if (m_parameters != null) {
      hash ^= m_parameters.hashCode();
    }
    if (m_correlations != null) {
      hash ^= m_correlations.hashCode();
    }

    return hash;
  }
示例#3
0
 /**
  * Is this error severity == FATAL?
  *
  * @return <b>true</b> if the severity is FATAL, <b>false</b> otherwise
  */
 public boolean isFatal() {
   return m_severity.equals(ErrorSeverity.FATAL);
 }
示例#4
0
 /**
  * Is this error severity == ERROR?
  *
  * @return <b>true</b> if the severity is ERROR, <b>false</b> otherwise
  */
 public boolean isError() {
   return m_severity.equals(ErrorSeverity.ERROR);
 }
示例#5
0
 /**
  * Is this error severity == WARNING?
  *
  * @return <b>true</b> if the severity is WARNING, <b>false</b> otherwise
  */
 public boolean isWarning() {
   return m_severity.equals(ErrorSeverity.WARNING);
 }
示例#6
0
 /**
  * Is this error severity == INFO?
  *
  * @return <b>true</b> if the severity is INFO, <b>false</b> otherwise
  */
 public boolean isInfo() {
   return m_severity.equals(ErrorSeverity.INFO);
 }