library / org.akop.kotx.tools / Bundler / putFields

putFields

fun putFields(outState: Bundle, obj: Any, keyPrefix: String? = null): Unit

For each field tagged with Storable, writes the value of the field to outState. The key used will be the name of the field (unless overridden by Storable.name), optionally prefixed with keyPrefix.

Note that fields must be writable to Bundle - that includes most primitives like Float, Int and Byte, classes like String, and Parcelables. Attempts to tag unsupported classes will throw a runtime exception.