Java Code Examples for org.wso2.carbon.utils.DataPaginator#doPaging()

The following examples show how to use org.wso2.carbon.utils.DataPaginator#doPaging() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: carbon-commons   File: LogViewerClient.java    License: Apache License 2.0 5 votes vote down vote up
private PaginatedLogEvent getPaginatedLogEvent(int pageNumber, List<LogEvent> logMsgList) {

        if (logMsgList != null && !logMsgList.isEmpty()) {
            PaginatedLogEvent paginatedLogEvent = new PaginatedLogEvent();
            DataPaginator.doPaging(pageNumber, logMsgList, paginatedLogEvent);
            return paginatedLogEvent;
        } else {
            return null;
        }
    }
 
Example 2
Source Project: carbon-commons   File: LogViewerClient.java    License: Apache License 2.0 5 votes vote down vote up
private PaginatedLogFileInfo getPaginatedLogFileInfo(int pageNumber,
                                                     List<LogFileInfo> logFileInfoList) {

    if (logFileInfoList != null && !logFileInfoList.isEmpty()) {
        PaginatedLogFileInfo paginatedLogFileInfo = new PaginatedLogFileInfo();
        DataPaginator.doPaging(pageNumber, logFileInfoList, paginatedLogFileInfo);
        return paginatedLogFileInfo;
    } else {
        return null;
    }
}
 
Example 3
public static PaginatedMappingData getPaginatedMappings(int pageNumber, String tenantDomain)
		throws UrlMapperException {
	MappingData[] mappings = HostUtil.getTenantSpecificMappingsFromRegistry(tenantDomain);
	if (mappings != null) {
		List<MappingData> mappingsList = Arrays.asList(mappings);
		// Pagination
		PaginatedMappingData paginatedMappings = new PaginatedMappingData();
		DataPaginator.doPaging(pageNumber, mappingsList, paginatedMappings);
		return paginatedMappings;
	} else {
		return null;
	}

}
 
Example 4
Source Project: carbon-identity-framework   File: Util.java    License: Apache License 2.0 4 votes vote down vote up
public static PaginatedNamesBean retrievePaginatedFlaggedName(int pageNumber, List<FlaggedName> names) {

        PaginatedNamesBean bean = new PaginatedNamesBean();
        DataPaginator.doPaging(pageNumber, names, bean);
        return bean;
    }
 
Example 5
Source Project: carbon-identity   File: Util.java    License: Apache License 2.0 4 votes vote down vote up
public static PaginatedNamesBean retrievePaginatedFlaggedName(int pageNumber, List<FlaggedName> names) {

        PaginatedNamesBean bean = new PaginatedNamesBean();
        DataPaginator.doPaging(pageNumber, names, bean);
        return bean;
    }