/** * Construct given a status, entity and metadata. * * @param status the status * @param headers the metadata, it is the callers responsibility to copy * the metadata if necessary. * @param entity the entity */ public JResponse(int status, OutBoundHeaders headers, E entity) { this(ResponseImpl.toStatusType(status), headers, entity); }
@Override public void setResponse(Response response) { this.isCommitted = false; this.out = null; this.response = response = (response != null) ? response : Responses.noContent().build(); this.mappedThrowable = null; if (response instanceof ResponseImpl) { final ResponseImpl responseImpl = (ResponseImpl)response; setStatusType(responseImpl.getStatusType()); setHeaders(response.getMetadata()); setEntity(responseImpl.getEntity(), responseImpl.getEntityType()); } else { setStatus(response.getStatus()); setHeaders(response.getMetadata()); setEntity(response.getEntity()); } }
public Response build() { final Response r = new ResponseImpl( statusType, getHeaders(), entity, entityType); reset(); return r; }
@Override public Family getFamily() { return toFamilyCode(statusCode); }
public Response build() { final Response r = new ResponseImpl( statusType, getHeaders(), entity, entityType); reset(); return r; }
@Override public Family getFamily() { return toFamilyCode(statusCode); }
@Override public void setStatus(int status) { this.statusType = ResponseImpl.toStatusType(status); }
@Override public void setResponse(Response response) { this.isCommitted = false; this.out = null; this.response = response = (response != null) ? response : Responses.noContent().build(); this.mappedThrowable = null; if (response instanceof ResponseImpl) { final ResponseImpl responseImpl = (ResponseImpl)response; setStatusType(responseImpl.getStatusType()); setHeaders(response.getMetadata()); setEntity(responseImpl.getEntity(), responseImpl.getEntityType()); } else { setStatus(response.getStatus()); setHeaders(response.getMetadata()); setEntity(response.getEntity()); } }
/** * Set the status. * * @param status the response status * @return the updated instance * @throws IllegalArgumentException if status is less than 100 or greater * than 599. */ public B status(int status) { return status(ResponseImpl.toStatusType(status)); }
@Override public void setResponse(Response response) { this.isCommitted = false; this.out = null; this.response = response = (response != null) ? response : Responses.noContent().build(); this.mappedThrowable = null; if (response instanceof ResponseImpl) { final ResponseImpl responseImpl = (ResponseImpl)response; setStatusType(responseImpl.getStatusType()); setHeaders(response.getMetadata()); setEntity(responseImpl.getEntity(), responseImpl.getEntityType()); } else { setStatus(response.getStatus()); setHeaders(response.getMetadata()); setEntity(response.getEntity()); } }
/** * Construct given a status, entity and metadata. * * @param status the status * @param headers the metadata, it is the callers responsibility to copy * the metadata if necessary. * @param entity the entity */ public JResponse(int status, OutBoundHeaders headers, E entity) { this(ResponseImpl.toStatusType(status), headers, entity); }
@Override public void setStatus(int status) { this.statusType = ResponseImpl.toStatusType(status); }
/** * Construct given a status, entity and metadata. * * @param status the status * @param headers the metadata, it is the callers responsibility to copy * the metadata if necessary. * @param entity the entity */ public JResponse(int status, OutBoundHeaders headers, E entity) { this(ResponseImpl.toStatusType(status), headers, entity); }
@Override public void setStatus(int status) { this.statusType = ResponseImpl.toStatusType(status); }
/** * Construct given a status, entity and metadata. * * @param status the status * @param headers the metadata, it is the callers responsibility to copy * the metadata if necessary. * @param entity the entity * @param entityType the entity type, it is the callers responsibility to * ensure the entity type is compatible with the entity. */ protected ResponseImpl(int status, OutBoundHeaders headers, Object entity, Type entityType) { this.statusType = toStatusType(status); this.headers = headers; this.entity = entity; this.entityType = entityType; }
/** * Construct given a status, entity and metadata. * * @param status the status * @param headers the metadata, it is the callers responsibility to copy * the metadata if necessary. * @param entity the entity * @param entityType the entity type, it is the callers responsibility to * ensure the entity type is compatible with the entity. */ protected ResponseImpl(int status, OutBoundHeaders headers, Object entity, Type entityType) { this.statusType = toStatusType(status); this.headers = headers; this.entity = entity; this.entityType = entityType; }
/** * Set the status. * * @param status the response status * @return the updated instance * @throws IllegalArgumentException if status is less than 100 or greater * than 599. */ public B status(int status) { return status(ResponseImpl.toStatusType(status)); }
public Response.ResponseBuilder status(int status) { return status(ResponseImpl.toStatusType(status)); }
/** * Set the status. * * @param status the response status * @return the updated instance * @throws IllegalArgumentException if status is less than 100 or greater * than 599. */ public B status(int status) { return status(ResponseImpl.toStatusType(status)); }
public Response.ResponseBuilder status(int status) { return status(ResponseImpl.toStatusType(status)); }