fernandocortez
03/15/2017, 8:41 PMfernandocortez
03/15/2017, 8:42 PMThis annotation is not applicable to target 'member property without backing field or delegate'
fernandocortez
03/15/2017, 8:44 PMmiha-x64
03/15/2017, 8:53 PMAndreas Sinz
03/15/2017, 9:16 PM@JvmField
https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#instance-fieldsAndreas Sinz
03/15/2017, 9:18 PMmiha-x64
03/15/2017, 9:57 PMismail-s
03/16/2017, 12:09 AMkirill_bulatov
03/16/2017, 8:17 AMfernandocortez
03/16/2017, 1:00 PMtoString
functiondathoang.se
03/16/2017, 4:27 PMmiha-x64
03/16/2017, 4:34 PMJvmClassMappingKt.getKotlinClass(javaClass)
.damian
03/16/2017, 4:35 PMJvmClassMappingKt.getKotlinClass(clazz)
dathoang.se
03/16/2017, 4:36 PMian.shaun.thomas
03/16/2017, 5:01 PMnkiesel
03/16/2017, 10:23 PMlistOf(1,2,3).mapNotNull { if (it %2 != 0) "hi ${it}" else null }
but (a) that relies on null
never being a valid result element and (b) does not work for flatMap
. Perhaps I should just use a classical for loop and add to the result list?nkiesel
03/16/2017, 10:25 PMcedric
03/16/2017, 10:35 PMfilter
?nkiesel
03/16/2017, 10:43 PMmap
i have a when(subdirname) { "foo" -> createFoo(subdirname); "bar" -> createBar(subdirname)
. any subdirs not "foo" or "bar" I want to ignore. So I would first have to filter on the names, and then still have the "when" in the map repeating the list of valid namesnkiesel
03/16/2017, 10:46 PMfilter { it.name in listOf("foo", "bar") }.map { when(it.name) { "foo" -> ...; "bar"->...; }
elect
03/17/2017, 7:20 AMmap
directly and filter all the rest out with else
?nkiesel
03/17/2017, 7:27 AMelect
03/17/2017, 8:51 AMmap { when(it.name) { "foo" -> ...; "bar"->...; else { /** this is your "filter" */} }
avolkmann
03/17/2017, 2:53 PMgjesse
03/17/2017, 3:47 PMdstarcev
03/17/2017, 3:51 PMas
do when used as a statement? override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
other as EntityNotFoundException
if (entityId != other.entityId) return false
if (entityType != other.entityType) return false
return true
}
dstarcev
03/17/2017, 3:51 PMneil
03/17/2017, 3:51 PMkevinmost
03/17/2017, 3:52 PM((EntityNotFoundException) other)
would do in Java