@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } BatchId other = (BatchId) obj; return eq(getId(), other.getId()); }
/** * Sets the number of entries processed successfully. * * @param successCount number of entries processed successfully or * <code>null</code> to reset */ public BatchInterrupted setSuccessCount(Integer successCount) { setAttributeValue(SUCCESS_COUNT, successCount); return this; }
/** * 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); }
/** Creates a 200 Success status object. */ public static BatchStatus createSuccessStatus() { BatchStatus status = new BatchStatus(); status.setCode(HttpURLConnection.HTTP_OK); status.setReason("Success"); return status; }
@Override public String toString() { return "{BatchStatus code=" + getAttributeValue(CODE) + " content=" + getTextValue() + " contentType=" + getAttributeValue(CONTENT_TYPE) + " reason=" + getAttributeValue(REASON) + "}"; } }
/** * Sets the error message explaining what went wrong while processing the * request. * * @param content error message explaining what went wrong while processing * the request or <code>null</code> to reset */ public BatchInterrupted setContent(String content) { setTextValue(content); return this; }
/** * Returns whether it has the error message explaining what went wrong while * processing the request. * * @return whether it has the error message explaining what went wrong while * processing the request */ public boolean hasContent() { return hasTextValue(); }
/** * 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; }
/** * Constructs a new instance with the given operation type. * * @param type operation type. */ public BatchOperation(BatchOperationType type) { this(); setType(type); }
/** * Returns whether it has the error message explaining what went wrong while * processing the request. * * @return whether it has the error message explaining what went wrong while * processing the request */ public boolean hasContent() { return hasTextValue(); }
/** * Sets the short message describing this status. * * @param reason short message describing this status or <code>null</code> to * reset */ public BatchStatus setReason(String reason) { setAttributeValue(REASON, reason); return this; }
@Override public String toString() { return "{BatchOperation type=" + getAttributeValue(TYPE) + "}"; } }
/** * Constructs a new instance with the given value. * * @param id value. */ public BatchId(String id) { this(); setId(id); }
@Override public String toString() { return "{BatchId id=" + getTextValue() + "}"; } }
/** * Returns whether it has the HTTP response code. * * @return whether it has the HTTP response code */ public boolean hasCode() { return getCode() != 0; }
/** * Sets the number of entries for which processing failed. * * @param errorCount number of entries for which processing failed or * <code>null</code> to reset */ public BatchInterrupted setErrorCount(Integer errorCount) { setAttributeValue(ERROR_COUNT, errorCount); return this; }
/** * Sets the number of entries parsed but not processed. * * @param skippedCount number of entries parsed but not processed or * <code>null</code> to reset */ public BatchInterrupted setSkippedCount(Integer skippedCount) { setAttributeValue(SKIPPED_COUNT, skippedCount); return this; }
/** * Sets the number of entries that were parsed. * * @param totalCount number of entries that were parsed or <code>null</code> * to reset */ public BatchInterrupted setTotalCount(Integer totalCount) { setAttributeValue(TOTAL_COUNT, totalCount); return this; }
/** * Sets the reason. * * @param reason reason or <code>null</code> to reset */ public BatchInterrupted setReason(String reason) { setAttributeValue(REASON, reason); return this; }
/** * Sets the number of entries processed successfully. * * @param successCount number of entries processed successfully or * <code>null</code> to reset */ public BatchInterrupted setSuccessCount(Integer successCount) { setAttributeValue(SUCCESS_COUNT, successCount); return this; }