osamarao
05/11/2018, 9:48 PMdata class Last(val symbol: String,
val price: Double,
val size: Int,
val time: Long) {
public fun getAdapter(): JsonAdapter<out Last> {
return GlobalMoshi.moshi.adapter(this::class.java)
}
}
if i want a getAdapter
function on every type i'd make an extension function right?
inline fun <reified T> T.moshiAdapter(): JsonAdapter<T> {
return GlobalMoshi.moshi.adapter(T::class.java)
}
but this isn't available on classes
What am i doing wrong here ?