Kotlin extensions method

74 Views Asked by At

How can I write extension function in kotlin for such function:

public abstract fun <T : TargetValue> getAverage(metric: StatisticsMetric, 
interval: DateInterval, 
timeUnit: TimeUnit,
mode: GroupingMode /* = compiled code */, 
result: (AsyncResult<kotlin.collections.Map<Info, T>, Error>) -> kotlin.Unit): kotlin.Unit

To be able call it like this: TargetValueV2 : TargetValue

"This function about signature".asFlow(): Flow<MyCustomDataEvent>

        val flowResult = sdk.getAverage<TargetValueV2>(
            metric = TIME,
            interval = DateInterval(startDay, currentDate),
            timeUnit = DAY,
            mode = private
        ).asFlow()
0

There are 0 best solutions below