Within Kotlin, I use it like this as a data type to assign to a lamda
val validateParent3X: _Validator_<_Egg_, _ValidationFailure_> = {...}
But I cannot use typealias from Java. What is the idiomatic way to use this Function type as data type on Java?
I see two unknows I have for java interoperability. 1. How can I idimotically refer a Function type 2. Function type being
suspend
v
Vampire
03/05/2021, 11:14 AM
This is untested and just out of my head while not being that Kotlin-skilled yet, but I think what you want is
This won’t address calling a suspend function from Java, though, which is a bigger can of worms.
TBH I’d suggest writing an adapter layer (in Kotlin) that is to be used by Java and exposes simpler interfaces, and adapts a SAM interface where the function returns