ValueConverter
Custom conversion for a field annotated with @Convert(MyConverter::class). Implement it as an object. Throw IllegalArgumentException for invalid input; the message becomes the error's cause.
object UrlConverter : ValueConverter<Url> {
override fun convert(raw: String): Url = Url(raw)
}Content copied to clipboard