net.nemerosa.ontrack.model.support.Page.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.support
class Page
@JvmOverloads
constructor(
var offset: Int = 0,
var count: Int = 100
) {
/**
* Extracts a sublist using pagination information
*
* @param list Initial list
* @param Type of elements in the list
* @return Sub list
*/
fun extract(list: List): List {
val toIndex = Math.min(
offset + count,
list.size
)
return list.subList(
offset,
toIndex
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy