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

ysny.karibu-tools.karibu-tools.0.20.source-code.DataProviderUtils.kt Maven / Gradle / Ivy

There is a newer version: 0.21
Show newest version
package com.github.mvysny.kaributools

import com.vaadin.flow.data.provider.DataProvider
import com.vaadin.flow.data.provider.Query
import com.vaadin.flow.data.provider.QuerySortOrder
import com.vaadin.flow.data.provider.SortDirection
import kotlin.reflect.KProperty1
import kotlin.streams.toList

/**
 * Returns all items provided by this data provider as an eager list. Careful with larger data!
 */
public fun  DataProvider.fetchAll(): List = fetch(Query()).toList()

public val  KProperty1.asc: QuerySortOrder get() = QuerySortOrder(name, SortDirection.ASCENDING)
public val  KProperty1.desc: QuerySortOrder get() = QuerySortOrder(name, SortDirection.DESCENDING)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy