bundle

fun bundle(prefix: String = "", vararg substitutions: Any?): BundleDelegate<Any?>

Creates a read-only property delegate that represents the value of the underlying bundle entry.

The returned delegate must be used only for one property, using the same bundle delegate on multiple properties will result in undefined behaviour.

The name of the bundle this delegate is bound to is determined by the name of the property, converted to kebab-case. In addiction, if prefix doesn't end with '-' or '.', a '.' is prepended. E.g.

val coolFeatureName by bundle("coolMod")

delegates to a bundle entry named "coolMod.cool-feature-name".

Additionally, a list of substitution objects can be provided. If the bundle entry fetched by the delegate contains structures like {1}, {2}, they will be replaced by the respective entries in the list.

Parameters

prefix

a string prepended to the name of the property.

substitutions

objects to replace curly bracket references with.


fun bundle(prefix: String = ""): BundleDelegate<Nothing>

Creates a bundle delegate with no substitutions.

See also