public class ResponseUtil extends Object
| Constructor and Description |
|---|
ResponseUtil() |
| Modifier and Type | Method and Description |
|---|---|
static javax.ws.rs.core.Response |
badRequest(String message) |
static void |
createPagingHeader(javax.ws.rs.core.Response.ResponseBuilder builder,
javax.ws.rs.core.UriInfo uriInfo,
Page<?> resultList)
Create the paging headers for collections and attach them to the passed builder.
|
static javax.ws.rs.core.Response |
internalError(String message) |
static javax.ws.rs.core.Response |
noContent() |
static javax.ws.rs.core.Response |
notFound(String message) |
static javax.ws.rs.core.Response |
ok() |
static javax.ws.rs.core.Response |
ok(Object entity) |
static <T> javax.ws.rs.core.Response |
paginatedOk(Page<T> page,
javax.ws.rs.core.UriInfo uri) |
public static javax.ws.rs.core.Response internalError(String message)
public static javax.ws.rs.core.Response noContent()
public static javax.ws.rs.core.Response notFound(String message)
public static javax.ws.rs.core.Response ok(Object entity)
public static <T> javax.ws.rs.core.Response paginatedOk(Page<T> page, javax.ws.rs.core.UriInfo uri)
public static javax.ws.rs.core.Response ok()
public static javax.ws.rs.core.Response badRequest(String message)
public static void createPagingHeader(javax.ws.rs.core.Response.ResponseBuilder builder,
javax.ws.rs.core.UriInfo uriInfo,
Page<?> resultList)
In addition a X-Total-Count header is created that contains the whole collection size.
builder - The ResponseBuilder that receives the headersuriInfo - The uriInfo of the incoming request to build the urlsresultList - The collection with its paging informationCopyright © 2015 Red Hat, Inc.. All rights reserved.