gorm.tools.beans.Pager.groovy Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2019 Yak.Works - Licensed under the Apache License, Version 2.0 (the "License")
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/
package gorm.tools.beans
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import groovy.transform.EqualsAndHashCode
import groovy.util.logging.Slf4j
import yakworks.commons.model.TotalCount
import yakworks.meta.MetaMapList
/**
* a holder object for both pager settings and the paged data, used mostly in the rest and views
* but can also be used for paging through and processing data
*/
@Slf4j
@CompileStatic
@SuppressWarnings('ConfusingMethodName') //for max and page
//XXX VOODOO Security and logging sometimes fails when this has and EqualsAndHashCode
@EqualsAndHashCode //(includes=["page", "max", "data", "params"])
class Pager implements Serializable{
/**
* The page we are on, pageNumber
*/
Integer page = 1
/**
* Max rows to show, the pageSize
*/
Integer max = 20
/**
* the max rows the user can set it to
*/
Integer allowedMax = 10000
/**
* The total record count. This is used to calculate the number of pages
*/
Integer recordCount = 0
/**
* Offset max * (page - 1)
*/
Integer offset
/**
* List of elements
*/
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy