StrRes

@Serializable
class StrRes

Unified string resource wrapper supporting platform-native resources (PlatformStrRes), Compose Multiplatform resources (StringResource, PluralStringResource), and plain text.

Not a data class - copy would allow creating invalid states (e.g. both platformStrRes and composeString set).

Format args: formatArgs apply to composeString, composePluralString, and text paths. PlatformStrRes uses its own format args; this formatArgs is ignored for that path.

Serialization: JSON only (FormatArgsSerializer requires JsonEncoder/JsonDecoder).

Constructors

Link copied to clipboard
constructor(platformStrRes: PlatformStrRes)
constructor(composeString: StringResource, formatArgs: ImmutableList<@Serializable Any> = persistentListOf())
constructor(composePluralString: PluralStringResource, quantity: Int, formatArgs: ImmutableList<@Serializable Any> = persistentListOf())
constructor(text: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val composePluralString: PluralStringResource?
Link copied to clipboard
@Serializable(with = StringResourceSerializer::class)
val composeString: StringResource?
Link copied to clipboard
@Serializable(with = FormatArgsSerializer::class)
val formatArgs: ImmutableList<Any>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val text: String?

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
fun StrRes.getString(context: ERROR CLASS: Symbol not found for Context): String?
fun StrRes.getString(resources: ERROR CLASS: Symbol not found for Resources): String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun getStringSuspend(): String?

Non-composable suspend resolution.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int