I have a Kotlin function which returns a map like Map<String, Pair<String, String>>
. I need to pass it to a java function and java does not seem to have a Pair data structure. What would be the best way to pass such a structure to the Java function?
You can just use Pair ( import kotlin.Pair;
), since that is compiled to a JVM class, this isn't any different from using any other kotlin class in java.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.