com.github.mvysny.vokdataloader.EmptyDataLoader.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vok-dataloader Show documentation
Show all versions of vok-dataloader Show documentation
VOK-DataLoader: The Paged/Filtered/Sorted DataLoader API
The newest version!
package com.github.mvysny.vokdataloader
/**
* Never returns any items.
*
* The native data set is always empty; therefore there is no data row and the [NativePropertyName] set is empty
* (there are no native properties). This loader accepts anything as [DataLoaderPropertyName]. The filters and
* sort clauses are always ignored.
*
* There is no mapping-to-Java-Bean going on since nothing is returned.
*/
public class EmptyDataLoader: DataLoader {
override fun getCount(filter: Filter?): Long = 0L
override fun fetch(filter: Filter?, sortBy: List, range: LongRange): List {
require(range.isEmpty() || range.first >= 0) { "range $range contains negative indices" }
return listOf()
}
override fun toString(): String = "EmptyDataLoader"
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy