All Downloads are FREE. Search and download functionalities are using the official Maven repository.

se.ansman.kotshi.GeneratedAdapter.kt Maven / Gradle / Ivy

Go to download

An annotations processor that generates Moshi adapters from Kotlin data classes

There is a newer version: 3.0.0
Show newest version
package se.ansman.kotshi

import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.TypeVariableName

data class GeneratedAdapter(
    val targetType: ClassName,
    val className: ClassName,
    val typeVariables: List,
    val requiresMoshi: Boolean = true
) {
    val requiresTypes: Boolean = typeVariables.isNotEmpty()
    init {
        assert(!requiresTypes || requiresMoshi) {
            "An adapter requiring types must also require a Moshi instance."
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy