WorkValue

@Serializable
sealed interface WorkValue

A value carried in a WorkInput payload.

Sealed to keep the type space small enough to map onto Android's androidx.work.Data (which only accepts primitives and arrays of primitives) and to JSON for iOS / macOS persistence.

Sticking to the Android subset cross-platform avoids a per-platform "supported types" mismatch.

Inheritors

Types

Link copied to clipboard
@Serializable
data class BooleanValue(val value: Boolean) : WorkValue
Link copied to clipboard
@Serializable
data class BytesValue(val value: ByteArray) : WorkValue
Link copied to clipboard
@Serializable
data class DoubleValue(val value: Double) : WorkValue
Link copied to clipboard
@Serializable
data class LongValue(val value: Long) : WorkValue
Link copied to clipboard
@Serializable
data class StringValue(val value: String) : WorkValue