public class BatchStatus extends Element implements IBatchStatus
Modifier and Type | Field and Description |
---|---|
static AttributeKey<java.lang.Integer> |
CODE
The HTTP response code.
|
static AttributeKey<ContentType> |
CONTENT_TYPE
The MIME type for the content of the error message contained in this
element.
|
static ElementKey<java.lang.String,BatchStatus> |
KEY
The key for this element.
|
static AttributeKey<java.lang.String> |
REASON
The short message describing this status.
|
Constructor and Description |
---|
BatchStatus()
Default mutable constructor.
|
BatchStatus(ServiceException e)
Creates a BatchStatus and initializes it
based on an exception.
|
Modifier and Type | Method and Description |
---|---|
static BatchStatus |
createCreatedStatus()
Creates a Success status object.
|
static BatchStatus |
createSuccessStatus()
Creates a 200 Success status object.
|
boolean |
equals(java.lang.Object obj) |
int |
getCode()
Returns the HTTP response code.
|
java.lang.String |
getContent()
Returns the error message explaining what went wrong while processing the
request.
|
ContentType |
getContentType()
Returns the MIME type for the content of the error message contained in
this element.
|
java.lang.String |
getReason()
Returns the short message describing this status.
|
boolean |
hasCode()
Returns whether it has the HTTP response code.
|
boolean |
hasContent()
Returns whether it has the error message explaining what went wrong while
processing the request.
|
boolean |
hasContentType()
Returns whether it has the MIME type for the content of the error message
contained in this element.
|
int |
hashCode() |
boolean |
hasReason()
Returns whether it has the short message describing this status.
|
static void |
registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
|
BatchStatus |
setCode(java.lang.Integer code)
Sets the HTTP response code.
|
BatchStatus |
setContent(java.lang.String content)
Sets the error message explaining what went wrong while processing the
request.
|
BatchStatus |
setContentType(ContentType contentType)
Sets the MIME type for the content of the error message contained in this
element.
|
BatchStatus |
setReason(java.lang.String reason)
Sets the short message describing this status.
|
java.lang.String |
toString() |
adapt, adapt, addElement, addElement, addElement, clear, createElement, createElement, eq, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hasTextValue, isLocked, lock, narrow, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, sameClassAs, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, validate, visit
public static final ElementKey<java.lang.String,BatchStatus> KEY
public static final AttributeKey<java.lang.Integer> CODE
public static final AttributeKey<ContentType> CONTENT_TYPE
public static final AttributeKey<java.lang.String> REASON
public BatchStatus()
public BatchStatus(ServiceException e)
e
- exception to initialize the status frompublic static void registerMetadata(MetadataRegistry registry)
public static BatchStatus createSuccessStatus()
public static BatchStatus createCreatedStatus()
public int getCode()
getCode
in interface IBatchStatus
public BatchStatus setCode(java.lang.Integer code)
code
- HTTP response code or null
to resetpublic boolean hasCode()
public java.lang.String getContent()
getContent
in interface IBatchStatus
public BatchStatus setContent(java.lang.String content)
content
- error message explaining what went wrong while processing
the request or null
to resetpublic boolean hasContent()
public ContentType getContentType()
getContentType
in interface IBatchStatus
public BatchStatus setContentType(ContentType contentType)
contentType
- MIME type for the content of the error message contained
in this element or null
to resetpublic boolean hasContentType()
public java.lang.String getReason()
getReason
in interface IBatchStatus
public BatchStatus setReason(java.lang.String reason)
reason
- short message describing this status or null
to
resetpublic boolean hasReason()