yakworks.commons.model.SimplePagedList.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of groovy-commons Show documentation
Show all versions of groovy-commons Show documentation
common groovy and java utils
/*
* Copyright 2022 original authors
* SPDX-License-Identifier: Apache-2.0
*/
package yakworks.commons.model
import groovy.transform.CompileStatic
/**
* Simple Paged List that delegates to a list and has the totalCount.
* Example would be for results from server where this list hold 10 results with totalCount = 100
* Intentionally simple with no tracking for what page its on etc..
*/
@CompileStatic
class SimplePagedList implements TotalCount {
@Delegate List results
SimplePagedList(List results, int tot) {
this.results = results
setTotalCount(tot)
}
}