com.linkedin.restli.common
Class CreateStatus

java.lang.Object
  extended by com.linkedin.data.template.RecordTemplate
      extended by com.linkedin.restli.common.CreateStatus
All Implemented Interfaces:
com.linkedin.data.template.DataTemplate<com.linkedin.data.DataMap>, java.lang.Cloneable

public class CreateStatus
extends com.linkedin.data.template.RecordTemplate

A Create response status. May optionally contain error details. The errors field is primarily for batch requests. For error responses to individual create requests, the response will only contains an error response and will not contain create status.


Constructor Summary
CreateStatus()
          Initialize an empty CreateStatus.
CreateStatus(com.linkedin.data.DataMap data)
          Initialize a CreateStatus off of a given DataMap.
 
Method Summary
 ErrorResponse getError()
          Gets the error for for the create status, if any.
 java.lang.String getId()
           
 java.lang.Integer getStatus()
           
 boolean hasError()
          Checks if the create status contains a error.
 void setError(ErrorResponse error)
          Sets the error response of the created item.
 void setId(java.lang.String id)
          Set the Id of the created item.
 void setStatus(java.lang.Integer status)
          Set the http status of the CreateStatus.
 
Methods inherited from class com.linkedin.data.template.RecordTemplate
clone, contains, copy, data, equals, hashCode, obtainDirect, obtainWrapped, putDirect, putDirect, putDirect, putWrapped, putWrapped, remove, schema, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateStatus

public CreateStatus()
Initialize an empty CreateStatus.


CreateStatus

public CreateStatus(com.linkedin.data.DataMap data)
Initialize a CreateStatus off of a given DataMap.

Parameters:
data - a DataMap
Method Detail

getStatus

public java.lang.Integer getStatus()
Returns:
the http status of the CreateStatus

setStatus

public void setStatus(java.lang.Integer status)
Set the http status of the CreateStatus.

Parameters:
status - the http status

getId

public java.lang.String getId()
Returns:
the Id of the created item

setId

public void setId(java.lang.String id)
Set the Id of the created item.

Parameters:
id - the Id

hasError

public boolean hasError()
Checks if the create status contains a error. This is primarily for batch requests. For error responses to individual create requests, the response only contains an error response and will not contain create status.

Returns:
true if the create status contains an error.

getError

public ErrorResponse getError()
Gets the error for for the create status, if any. This is primarily for batch requests. For error responses to individual create requests, the response will only contains an error response and will not contain create status.

Returns:
the error if it exists, otherwise null.

setError

public void setError(ErrorResponse error)
Sets the error response of the created item. This is primarily for batch requests. For error responses to individual create requests, the response will only contains an error response and will not contain create status.

Parameters:
error - the error.