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

se.ansman.kotshi.kapt.AnnotationMirrors.kt Maven / Gradle / Ivy

Go to download

An annotations processor that generates Moshi adapters from Kotlin data classes

The newest version!
package se.ansman.kotshi.kapt

import javax.lang.model.element.AnnotationMirror

inline fun  AnnotationMirror.getValue(name: String): R =
    getValueOrNull(name) ?: throw IllegalArgumentException("Annotation $this has no value $name")

inline fun  AnnotationMirror.getValueOrNull(name: String): R? =
    elementValues.entries
        .find { it.key.simpleName.contentEquals(name) }
        ?.value
        ?.value as R?




© 2015 - 2024 Weber Informatics LLC | Privacy Policy