public abstract class PageBuilderUtils extends Object
Utility methods.
| Modifier and Type | Method and Description |
|---|---|
static <E,T> PageDto |
createPageDto(Page<E> page,
PageEntryTransformer<T,E> transformer)
Transforms a page into a page DTO.
|
static PageRequestDto |
createPageRequestDto(PageRequest pageRequest)
Transforms a page request into a page request DTO.
|
static <T> T |
jsonMapToObject(Map<String,Object> map,
Class<T> valueType,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Transforms a JSON map to an object.
|
public static <E,T> PageDto createPageDto(Page<E> page, PageEntryTransformer<T,E> transformer)
page - the pagetransformer - the transformer (may be null - than all entries of the
page will be added to the DTO without transforming)public static PageRequestDto createPageRequestDto(PageRequest pageRequest)
pageRequest - the page request (can be null)null)public static <T> T jsonMapToObject(Map<String,Object> map, Class<T> valueType, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws IOException
map - the JSON mapvalueType - the class of the target objectobjectMapper - the JSON object mapper (optional)IOException - if transformation failsCopyright © 2016 bremersee.org. All rights reserved.