Package-level declarations

Types

Link copied to clipboard
value class BitField<T : Enum<T>>(value: ULong)

A type-safe bit field implementation for efficient flag operations.

Link copied to clipboard

Builder class for constructing BitFields fluently.

Link copied to clipboard
annotation class BitFieldDsl

DSL for creating BitFields with natural syntax.

Link copied to clipboard
class BitFieldScope<T : Enum<T>>
Link copied to clipboard
interface IFlagValue

Functions

Link copied to clipboard
inline fun <T : Enum<T>> BitField<T>.allFlags(enumValues: Array<T>, predicate: (T) -> Boolean): Boolean

Checks if all set flags match the predicate.

Link copied to clipboard
inline fun <T : Enum<T>> BitField<T>.anyFlag(enumValues: Array<T>, predicate: (T) -> Boolean): Boolean

Checks if any set flag matches the predicate.

Link copied to clipboard
inline fun <T : Enum<T>> buildBitField(builder: BitFieldBuilder<T>.() -> Unit): BitField<T>

Creates a BitField using builder pattern.

Link copied to clipboard
inline fun <T : Enum<T>> BitField<T>.filterFlags(enumValues: Array<T>, predicate: (T) -> Boolean): List<T>

Filters the set flags based on a predicate.

Link copied to clipboard
inline fun <T : Enum<T>> BitField<T>.forEachFlag(enumValues: Array<T>, action: (T) -> Unit)

Applies an action to each set flag.

Link copied to clipboard
inline fun <T : Enum<T>, R> BitField<T>.ifNotEmpty(transform: (BitField<T>) -> R): R?

Applies a transformation to a BitField if it's not empty.

Link copied to clipboard
inline fun <T : Enum<T>, R> BitField<T>.mapFlags(enumValues: Array<T>, transform: (T) -> R): List<R>

Maps the set flags to a list of results.

Link copied to clipboard
fun <T : Enum<T>> T.toBitField(): BitField<T>

Creates a BitField from this enum value.

fun <T : Enum<T>> Array<T>.toBitField(): BitField<T>

Creates a BitField from an array of enum values.

Creates a BitField from a collection of enum values.