CompositeStringResolver

data class CompositeStringResolver(resolvers: List<StringResolver>, separator: StringResolver) : StringResolver

A StringResolver that creates a string from the given resolvers, separated using separator.

For example:

val composite = CompositeStringResolver(
listOf(
StaticStringResolver("Hello"),
StaticStringResolver("world")
)
)

// Will equal "Hello world"
composite.get(context)

Do keep RTL languages in mind when selecting the separator, you probably want to use a ResourceStringResolver if your separator isn't a palindrome.

Resolvers resulting in empty strings are ignored.

Constructors

Link copied to clipboard
fun CompositeStringResolver(resolvers: List<StringResolver>, separator: StringResolver = StaticStringResolver(" "))

Functions

Link copied to clipboard
open override fun get(context: Context): String

Resolves a String based on the given Context. The resulting value may differ per Context. E.g. due to differing locales.

Inherited functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)