IncludeStatesModelCollection

class IncludeStatesModelCollection<T : Any, C : KlerkContext>(previous: ModelCollection<T, C>, included: Set<String>?, excluded: Set<String>?) : ModelCollection<T, C>

Constructors

Link copied to clipboard
constructor(previous: ModelCollection<T, C>, included: Set<String>?, excluded: Set<String>?)

Functions

Link copied to clipboard
open fun <V> contains(value: ModelID<*>, reader: Reader<C, V>): Boolean
Link copied to clipboard
fun <V> count(reader: Reader<C, V>): Int
Link copied to clipboard
open fun filter(filter: (Model<T>) -> Boolean?): ModelCollection<T, C>
Link copied to clipboard
fun filterStates(included: Set<String>? = null, excluded: Set<String>? = null): ModelCollection<T, C>
Link copied to clipboard
Link copied to clipboard
open fun getId(): String
Link copied to clipboard
open fun getView(): ModelCollections<T, C>
Link copied to clipboard
fun <V> isEmpty(reader: Reader<C, V>): Boolean
Link copied to clipboard
fun <D> readWith(reader: Reader<C, D>): List<Model<T>>
Link copied to clipboard

Makes Klerk aware of this collection. It will be included in Config.getCollections()

Link copied to clipboard
fun <R : Comparable<R>> sorted(selector: (Model<T>) -> R, ascending: Boolean = true): ModelCollection<T, C>
Link copied to clipboard
open override fun <V> withReader(reader: Reader<C, V>, cursor: QueryListCursor?): Sequence<Model<T>>

Creates a Sequence of the Collection content. It is usually better to use the methods in Reader (query, list etc.) but if you must use this, be careful to not use it after you have released the Reader since that may lead to ConcurrentModificationException.