All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mvysny.vokdataloader.EmptyDataLoader.kt Maven / Gradle / Ivy

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