Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.rules/Rule

Rule

sealed class Rule<T> : DataItemConvertible

Simple Rule builder class for building out logical rules, that can be serialized to a DataItem The type of T should therefore either implement DataItemConvertible or be one of the types supported by DataItem

The type T is the required input type, e.g. Condition for complex rules or String for

Types

Companion
Link copied to clipboard
object Companion
Converter
Link copied to clipboard
class Converter<T>(converter: DataItemConverter<T>) : DataItemConverter<Rule<T>>

DataItemConverter implementation that handles the re-creation of the Rule operators, delegating the creation of the T to the provided converter.

Functions

and
Link copied to clipboard
@SafeVarargs
fun and(vararg others: Rule<T>): Rule<T>

Returns a new Rule that is the logical equivalent of the following operation:

asDataItem
Link copied to clipboard
abstract fun asDataItem(): DataItem

Should return an instance of a DataItem that represents all required properties of the implementing class, such that it could be:

asMatchable
Link copied to clipboard
fun <R> asMatchable(converter: (T) -> Matchable<R>): Matchable<R>

Takes a Rule implementation and converts it another Rule, wrapping the type of T in a Matchable so it can be evaluated.

asMatchable
Link copied to clipboard
fun <T : Matchable<R>, R> Rule<T>.asMatchable(): Matchable<R>

Convenience method to convert a Rule to a Matchable

matches
Link copied to clipboard
fun <T : Matchable<R>, R> Rule<T>.matches(input: R): Boolean

Convenience method to determine if a Rule is satisfied by the given input.

not
Link copied to clipboard
fun not(): Rule<T>

Returns a new Rule that is the logical equivalent of the following operation:

or
Link copied to clipboard
@SafeVarargs
fun or(vararg others: Rule<T>): Rule<T>

Returns a new Rule that is the logical equivalent of the following:

Generated by Dokka
(c) Tealium 2026