
se.ansman.kotshi.NamedJsonAdapter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
An annotations processor that generates Moshi adapters from Kotlin data classes
The newest version!
package se.ansman.kotshi
import com.squareup.moshi.JsonAdapter
/**
* A [JsonAdapter] that implements `toString`. This class is here to avoid adding one extra method per generated
* adapter.
*
* This class should not be considered part of the Kotshi's public API and can change at any time without notice.
*
* @param T The type that this adapter can serialize and deserialize. Cannot be nullable.
* @param toString The value that should be returned from [toString].
*/
@InternalKotshiApi
abstract class NamedJsonAdapter protected constructor(private val toString: String) : JsonAdapter() {
final override fun toString(): String = toString
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy