public class ModelUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PAGING_CONFIDENCE |
static String |
PAGING_MAX_ITEMS |
static String |
PAGING_SKIP_COUNT |
static String |
PAGING_TOTAL_ITEMS |
static String |
PAGING_TOTAL_ITEMS_RANGE_END |
Constructor and Description |
---|
ModelUtil() |
Modifier and Type | Method and Description |
---|---|
static Map<String,Object> |
buildPaging(int totalItems,
int maxItems,
int skipCount)
Returns representation of paging object
|
static Map<String,Object> |
buildPaging(int totalItems,
int maxItems,
int skipCount,
ScriptPagingDetails.ItemsSizeConfidence confidence,
int totalItemsRangeEnd)
Returns representation of paging object
|
static Map<String,Object> |
buildPaging(ScriptPagingDetails paging)
Returns representation of paging object
|
static String |
getProductName(RepoAdminService repoAdminService)
Returns the name of the product currently running, determined
by the current license.
|
static <T> List<T> |
page(Collection<T> objects,
int maxItems,
int skipCount) |
static <T> List<T> |
page(Collection<T> objects,
ScriptPagingDetails paging) |
static <T> T[] |
page(T[] objects,
int maxItems,
int skipCount) |
public static final String PAGING_MAX_ITEMS
public static final String PAGING_SKIP_COUNT
public static final String PAGING_TOTAL_ITEMS
public static final String PAGING_TOTAL_ITEMS_RANGE_END
public static final String PAGING_CONFIDENCE
public static String getProductName(RepoAdminService repoAdminService)
repoAdminService
- The RepoAdminServicepublic static Map<String,Object> buildPaging(int totalItems, int maxItems, int skipCount, ScriptPagingDetails.ItemsSizeConfidence confidence, int totalItemsRangeEnd)
totalItems
- all count of objectmaxItems
- max count of object that should be returnedskipCount
- count of skipped objectsconfidence
- the confidence in the total, default is exacttotalItemsRangeEnd
- if the total is a range, what is the upper end of itpublic static Map<String,Object> buildPaging(int totalItems, int maxItems, int skipCount)
totalItems
- all count of objectmaxItems
- max count of object that should be returnedskipCount
- count of skipped objectspublic static Map<String,Object> buildPaging(ScriptPagingDetails paging)
paging
- The paging object with total, skip, max etcpublic static <T> List<T> page(Collection<T> objects, int maxItems, int skipCount)
public static <T> List<T> page(Collection<T> objects, ScriptPagingDetails paging)
public static <T> T[] page(T[] objects, int maxItems, int skipCount)
Copyright © 2005–2017 Alfresco Software. All rights reserved.