public class ResponseImpl extends Response
Response
.
This implementation supports the declaration of an entity type that will be
utilized when a MessageBodyWriter
is selected to write out the
entity.
Response.ResponseBuilder, Response.Status, Response.StatusType
Modifier | Constructor and Description |
---|---|
protected |
ResponseImpl(int status,
OutBoundHeaders headers,
java.lang.Object entity,
java.lang.reflect.Type entityType)
Construct given a status, entity and metadata.
|
protected |
ResponseImpl(Response.StatusType statusType,
OutBoundHeaders headers,
java.lang.Object entity,
java.lang.reflect.Type entityType)
Construct given a status type, entity and metadata.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getEntity()
Return the response entity.
|
java.lang.reflect.Type |
getEntityType()
Get the entity type.
|
MultivaluedMap<java.lang.String,java.lang.Object> |
getMetadata()
Get metadata associated with the response as a map.
|
int |
getStatus()
Get the status code associated with the response.
|
Response.StatusType |
getStatusType()
Get the status type.
|
static Response.Status.Family |
toFamilyCode(int statusCode) |
static Response.StatusType |
toStatusType(int statusCode) |
created, fromResponse, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, temporaryRedirect
protected ResponseImpl(Response.StatusType statusType, OutBoundHeaders headers, java.lang.Object entity, java.lang.reflect.Type entityType)
statusType
- the status typeheaders
- the metadata, it is the callers responsibility to copy
the metadata if necessary.entity
- the entityentityType
- the entity type, it is the callers responsibility to
ensure the entity type is compatible with the entity.protected ResponseImpl(int status, OutBoundHeaders headers, java.lang.Object entity, java.lang.reflect.Type entityType)
status
- the statusheaders
- the metadata, it is the callers responsibility to copy
the metadata if necessary.entity
- the entityentityType
- the entity type, it is the callers responsibility to
ensure the entity type is compatible with the entity.public Response.StatusType getStatusType()
public java.lang.reflect.Type getEntityType()
public int getStatus()
Response
public MultivaluedMap<java.lang.String,java.lang.Object> getMetadata()
Response
RuntimeDelegate.HeaderDelegate
if one is available via
RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the class of the value or using the values toString
method if a
header delegate is not available.getMetadata
in class Response
public java.lang.Object getEntity()
Response
GenericEntity
, the value of GenericEntity.getRawType()
.getEntity
in class Response
MessageBodyWriter
public static Response.StatusType toStatusType(int statusCode)
public static Response.Status.Family toFamilyCode(int statusCode)
Copyright © 2016 Oracle Corporation. All Rights Reserved.