james
01/19/2020, 10:36 PMjames
01/19/2020, 10:38 PM.sortedWith(
compareBy(
{ it is SomeType },
{ (it as? SomeOtherType)?.stringField }
)
)
steenooo
01/20/2020, 1:11 PMuser
01/21/2020, 10:30 AMuser
01/21/2020, 10:59 AMmonica85rodrigues
01/21/2020, 11:54 AMShineman730
01/21/2020, 11:55 AMSandy
01/21/2020, 5:32 PMPrasad
01/21/2020, 5:40 PMLeoColman
01/21/2020, 7:42 PMec
01/21/2020, 8:02 PMClazz<T>
like things with reified it was too easy. Is there anything problematic about this?
class Serde {
var mapper = jacksonObjectMapper()
fun <R>serialize(instance: R): ByteArray {
return mapper.writeValueAsBytes(instance)
}
inline fun <reified R>deserialize(arr: ByteArray): R {
return mapper.readValue<R>(arr)
}
}
Jak
01/22/2020, 5:23 AMNick
01/22/2020, 4:01 PMmike_shysh
01/22/2020, 4:29 PMuser
01/23/2020, 8:05 AMMichael de Kaste
01/23/2020, 1:56 PMiex
01/23/2020, 1:59 PMJsonObject
to a Map<String, String>
?
Gson().fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
Sylvain Patenaude
01/23/2020, 2:29 PMlinking module flags 'SDK Version': IDs have conflictiing values...
Posted in #multiplatformuser
01/23/2020, 4:30 PMnkiesel
01/23/2020, 7:17 PMManager
delegates all calls to an implementation of an interface Service
(there are multiple possible implementations of Service
, Manager
picks one at startup). Right now, the code does
object Manager { val delegate = pickImpl(); @JvmStatic fun foo() = delegate.foo(); @JvmStatic fun bar(a: Int) = delegate.bar(a); ... }
and the Java code calls Manager.foo()
. This could be simplified to object Manager : Service by pickImpl()
but then the Java code has to be changed to call Manager.INSTANCE.foo()
. Is there a way to use delegation but retain the JVMStatic
for the Java code?mike_shysh
01/24/2020, 2:49 PMnatpryce
01/24/2020, 2:57 PMenighma
01/24/2020, 10:12 PMgammax
01/24/2020, 10:26 PMNicholas Bilyk
01/24/2020, 11:01 PMJonny
01/25/2020, 12:53 AMArtyom Gornostayev
01/25/2020, 1:29 PMinit.gradle.kts
with Kotlin DSL?
For example, this does not work:
initscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8")
}
}
allprojects {
pluginManager.apply(org.sonarqube.gradle.SonarQubePlugin)
}
Reason:
Line 11: pluginManager.apply(org.sonarqube.gradle.SonarQubePlugin)
^ Classifier 'SonarQubePlugin' does not have a companion object, and thus must be initialized here
Artyom Gornostayev
01/25/2020, 1:51 PM::class
... Sorry about that.Sagar Suri
01/26/2020, 3:28 AMclass EventRepository(val bikeEventHelper: BikeEventHelper, val carEventHelper: CarEventHelper){
fun carEventHelper() = carEventHelper
fun bikeEventHelper() = bikeEventHelper
}
Looking for suggestions on naming the EventRepository
class.Chills
01/26/2020, 2:12 PM