v79
03/23/2018, 1:17 PMinterface Converter {
fun convert(from:String) : Any?
}
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class SparkConverter(val converterClass: KClass<Converter>)
implemented by:
class MyTimeHourConverter: Converter {
override fun convert(hoursString: String): Int {
return hoursString.toInt()
}
}
But I can't call it because I have a type mismatch:
data class MyTime(@SparkConverter(converterClass = MyTimeHourConverter::class) val hours: Int, val minutes: Int)
Apparently not recognising that MyTimeHourConverter
does implement the Converter
interface?