RulesBuilder

abstract class RulesBuilder<T : Rules>

Base class for building rules

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun add(rule: T): RulesBuilder<T>

Add rule to the collection.

fun add(vararg rules: T): RulesBuilder<T>

Add one or more rules to the collection.

fun add(rules: Collection<T>): RulesBuilder<T>

Add multiple rules to the collection.

Link copied to clipboard
abstract fun all(statuses: List<RuleStatus> = listOf(RuleStatus.AVAILABLE)): RulesBuilder<T>

Adds all rules matching the provided statuses to the collection.

Link copied to clipboard
fun build(): List<Rule>

Build the rules collection.

Link copied to clipboard
fun remove(rule: T): RulesBuilder<T>

Remove a rule from the collection.

fun remove(vararg rules: T): RulesBuilder<T>

Remove one or more rules from the collection.

Remove multiple rules from the collection.

Link copied to clipboard

Removes all rules from the collection.