com.google.gdata.model.batch
Class BatchStatus

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.batch.BatchStatus
All Implemented Interfaces:
IBatchStatus

public class BatchStatus
extends Element
implements IBatchStatus

Describes server status information about how an entry was processed in a batch operation.


Field Summary
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 Summary
BatchStatus()
          Default mutable constructor.
BatchStatus(ServiceException e)
          Creates a BatchStatus and initializes it based on an exception.
 
Method Summary
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()
           
 
Methods inherited from class com.google.gdata.model.Element
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final ElementKey<java.lang.String,BatchStatus> KEY
The key for this element.


CODE

public static final AttributeKey<java.lang.Integer> CODE
The HTTP response code.


CONTENT_TYPE

public static final AttributeKey<ContentType> CONTENT_TYPE
The MIME type for the content of the error message contained in this element.


REASON

public static final AttributeKey<java.lang.String> REASON
The short message describing this status.

Constructor Detail

BatchStatus

public BatchStatus()
Default mutable constructor.


BatchStatus

public BatchStatus(ServiceException e)
Creates a BatchStatus and initializes it based on an exception.

Parameters:
e - exception to initialize the status from
Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


createSuccessStatus

public static BatchStatus createSuccessStatus()
Creates a 200 Success status object.


createCreatedStatus

public static BatchStatus createCreatedStatus()
Creates a Success status object.


getCode

public int getCode()
Returns the HTTP response code.

Specified by:
getCode in interface IBatchStatus
Returns:
HTTP response code

setCode

public BatchStatus setCode(java.lang.Integer code)
Sets the HTTP response code.

Parameters:
code - HTTP response code or null to reset

hasCode

public boolean hasCode()
Returns whether it has the HTTP response code.

Returns:
whether it has the HTTP response code

getContent

public java.lang.String getContent()
Returns the error message explaining what went wrong while processing the request.

Specified by:
getContent in interface IBatchStatus
Returns:
error message explaining what went wrong while processing the request

setContent

public BatchStatus setContent(java.lang.String content)
Sets the error message explaining what went wrong while processing the request.

Parameters:
content - error message explaining what went wrong while processing the request or null to reset

hasContent

public boolean hasContent()
Returns whether it has the error message explaining what went wrong while processing the request.

Returns:
whether it has the error message explaining what went wrong while processing the request

getContentType

public ContentType getContentType()
Returns the MIME type for the content of the error message contained in this element.

Specified by:
getContentType in interface IBatchStatus
Returns:
MIME type for the content of the error message contained in this element

setContentType

public BatchStatus setContentType(ContentType contentType)
Sets the MIME type for the content of the error message contained in this element.

Parameters:
contentType - MIME type for the content of the error message contained in this element or null to reset

hasContentType

public boolean hasContentType()
Returns whether it has the MIME type for the content of the error message contained in this element.

Returns:
whether it has the MIME type for the content of the error message contained in this element

getReason

public java.lang.String getReason()
Returns the short message describing this status.

Specified by:
getReason in interface IBatchStatus
Returns:
short message describing this status

setReason

public BatchStatus setReason(java.lang.String reason)
Sets the short message describing this status.

Parameters:
reason - short message describing this status or null to reset

hasReason

public boolean hasReason()
Returns whether it has the short message describing this status.

Returns:
whether it has the short message describing this status

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Element

hashCode

public int hashCode()
Overrides:
hashCode in class Element

toString

public java.lang.String toString()
Overrides:
toString in class Element