Skip to content

Instantly share code, notes, and snippets.

View ViewModelInject_Basics.kt
class MyViewModel
@ViewModelInject constructor(
Long foo, @Assisted SavedStateHandle savedStateHandle
): ViewModel() {
@Module(includes = ViewModelInject_VMModule::class)
abstract class VMModule {}
hansenji / savedstate_boilerplate.kt
Last active Apr 1, 2019
View savedstate_boilerplate.kt
interface Factory : ViewModelAssistedFactory<MyViewModel>
abstract class DetailModule {
abstract fun bindFactory(factory: MyViewModel.Factory): ViewModelAssistedFactory
hansenji / JacksonKotlinModuleExample.kt
Created Apr 4, 2017
Jackson Kotlin Module Example
View JacksonKotlinModuleExample.kt
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
fun main(args: Array<String>) {
// val mapper = ObjectMapper().registerModule(KotlinModule())
// val mapper = ObjectMapper().registerKotlinModule()
val mapper = jacksonObjectMapper()
val writer = mapper.writerWithDefaultPrettyPrinter()
val json1 = writer.writeValueAsString(Data1(1, "Foo", "Bar"))
You can’t perform that action at this time.