@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } BatchInterrupted other = (BatchInterrupted) obj; return eq(getContent(), other.getContent()) && eq(getContentType(), other.getContentType()) && eq(getErrorCount(), other.getErrorCount()) && eq(getReason(), other.getReason()) && eq(getSkippedCount(), other.getSkippedCount()) && eq(getSuccessCount(), other.getSuccessCount()) && eq(getTotalCount(), other.getTotalCount()); }
/** * Returns the reason. * * @return reason */ public String getReason() { return getAttributeValue(REASON); }
@Override public String toString() { return "{BatchInterrupted content=" + getTextValue() + " contentType=" + getAttributeValue(CONTENT_TYPE) + " errorCount=" + getAttributeValue(ERROR_COUNT) + " reason=" + getAttributeValue(REASON) + " skippedCount=" + getAttributeValue(SKIPPED_COUNT) + " successCount=" + getAttributeValue(SUCCESS_COUNT) + " totalCount=" + getAttributeValue(TOTAL_COUNT) + "}"; }
@Override public int hashCode() { int result = getClass().hashCode(); if (getContent() != null) { result = 37 * result + getContent().hashCode(); } if (getContentType() != null) { result = 37 * result + getContentType().hashCode(); } result = 37 * result + getErrorCount(); if (getReason() != null) { result = 37 * result + getReason().hashCode(); } result = 37 * result + getSkippedCount(); result = 37 * result + getSuccessCount(); result = 37 * result + getTotalCount(); return result; }
/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; setContent(se.getResponseBody()); setContentType(se.getResponseContentType()); } }
/** * Returns the error message explaining what went wrong while processing the * request. * * @return error message explaining what went wrong while processing the * request */ public String getContent() { return getTextValue(KEY); }
/** * Returns whether it has the MIME type of the content of this element. * * @return whether it has the MIME type of the content of this element */ public boolean hasContentType() { return getContentType() != null; }
/** * Returns whether it has the number of entries processed successfully. * * @return whether it has the number of entries processed successfully */ public boolean hasSuccessCount() { return getSuccessCount() != 0; }
/** * Returns whether it has the number of entries parsed but not processed. * * @return whether it has the number of entries parsed but not processed */ public boolean hasSkippedCount() { return getSkippedCount() != 0; }
/** * Returns true if the error count exists. */ public boolean hasErrorCount() { return getErrorCount() != 0; }
/** * Returns whether it has the reason. * * @return whether it has the reason */ public boolean hasReason() { return getReason() != null; }
@Override public int hashCode() { int result = getClass().hashCode(); if (getContent() != null) { result = 37 * result + getContent().hashCode(); } if (getContentType() != null) { result = 37 * result + getContentType().hashCode(); } result = 37 * result + getErrorCount(); if (getReason() != null) { result = 37 * result + getReason().hashCode(); } result = 37 * result + getSkippedCount(); result = 37 * result + getSuccessCount(); result = 37 * result + getTotalCount(); return result; }
/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; setContent(se.getResponseBody()); setContentType(se.getResponseContentType()); } }
/** * Returns the error message explaining what went wrong while processing the * request. * * @return error message explaining what went wrong while processing the * request */ public String getContent() { return getTextValue(KEY); }
/** * Returns whether it has the MIME type of the content of this element. * * @return whether it has the MIME type of the content of this element */ public boolean hasContentType() { return getContentType() != null; }
/** * Returns whether it has the number of entries processed successfully. * * @return whether it has the number of entries processed successfully */ public boolean hasSuccessCount() { return getSuccessCount() != 0; }
/** * Returns whether it has the number of entries parsed but not processed. * * @return whether it has the number of entries parsed but not processed */ public boolean hasSkippedCount() { return getSkippedCount() != 0; }
/** * Returns true if the error count exists. */ public boolean hasErrorCount() { return getErrorCount() != 0; }
/** * Returns whether it has the reason. * * @return whether it has the reason */ public boolean hasReason() { return getReason() != null; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } BatchInterrupted other = (BatchInterrupted) obj; return eq(getContent(), other.getContent()) && eq(getContentType(), other.getContentType()) && eq(getErrorCount(), other.getErrorCount()) && eq(getReason(), other.getReason()) && eq(getSkippedCount(), other.getSkippedCount()) && eq(getSuccessCount(), other.getSuccessCount()) && eq(getTotalCount(), other.getTotalCount()); }