DefaultHandler

Defines a handler for parsing a string value into an object of a specific type.

Implementations of this interface are responsible for converting a raw string value (typically from a @Default annotation) into the desired target type.

Example:

DefaultHandlers.register(MyType::class.java) { raw, _ -> MyType.parse(raw) }

See also

to register custom handlers

Functions

Link copied to clipboard
abstract fun parse(raw: Any?, type: Class<*>): Any?

Parses the provided raw string into an object of the given type.