agomez
10/27/2017, 1:37 AMuse
is an extension function on Closeable
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/use.htmlagomez
10/27/2017, 1:38 AMSession
implements it?jasper
10/27/2017, 1:47 AMorg.neo4j.driver.v1.Session
Is there a way for a pure java class to implement that?jasper
10/27/2017, 1:48 AMgildor
10/27/2017, 1:50 AMuse
implementation for this class (or some other interface, implemented by Session)jasper
10/27/2017, 1:51 AMjasper
10/27/2017, 1:51 AMgildor
10/27/2017, 1:53 AMuse
just add dependency on org.jetbrains.kotlin:kotlin-stdlib-jre7
(or jre8 if you use Java 8)jasper
10/27/2017, 1:54 AMjasper
10/27/2017, 1:54 AMjasper
10/27/2017, 1:57 AMzarkopafilis
10/27/2017, 8:44 AMkarelpeeters
10/27/2017, 8:45 AMkarelpeeters
10/27/2017, 8:45 AMzarkopafilis
10/27/2017, 8:57 AMzarkopafilis
10/27/2017, 8:57 AMzarkopafilis
10/27/2017, 8:57 AMmikehearn
10/27/2017, 12:21 PMmikehearn
10/27/2017, 12:21 PMmikehearn
10/27/2017, 12:22 PMmikehearn
10/27/2017, 12:22 PMnerses
10/27/2017, 2:07 PMhttps://cdn.programiz.com/sites/tutorial2program/files/growth-of-kotlin.png▾
poohbar
10/27/2017, 3:38 PMenum class Color(val name: String) {
RED("red"),
GREEN("green"),
BLUE("blue")
}
and I would like to have a function which tells me whether the name corresponds to any of the enum instances:
isContainedInEnum("blue") == true
Any good way to do this? The syntax can be a bit different if needed.cdurham
10/27/2017, 3:40 PMColor.values
and check each name against the method's argumentpoohbar
10/27/2017, 3:41 PM540grunkspin
10/27/2017, 3:49 PMrook
10/27/2017, 4:04 PMColor
and String
rook
10/27/2017, 4:21 PM===
, but ==
seems weirdmarstran
10/27/2017, 5:00 PMError:java: module kotlin.stdlib.jre8 reads package kotlin from both kotlin.stdlib and kotlin.stdlib.jre7.
karelpeeters
10/27/2017, 5:02 PMstdlib-jre8
isn't an option?