Using a kotlin library in java code

为君一笑 提交于 2019-12-05 08:11:32

Class kotlin.Pair belongs to the standard library org.jetbrains.kotlin:kotlin-stdlib:1.0.0, so you must have this library as a dependancy.

It is NOT recommended to use Pair in public APIs. Rather than that, create your own data class with 2 properties and give them a clearer naming than first and second.

The purpose of Pair is to server as a temporary data carrier in any intermediate operation. If you use it in your API, you lose in clarity.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!