KotshiJsonAdapterFactory

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class KotshiJsonAdapterFactory(val useAdaptersForPrimitives: Boolean = false, val serializeNulls: SerializeNulls = SerializeNulls.DEFAULT)(source)

Annotation to be applied on an abstract class that implements JsonAdapter.Factory to tell Kotshi to generate a factory containing all adapters in this module.

Example:

@KotshiJsonAdapterFactory
object ApplicationJsonAdapterFactory : JsonAdapter.Factory by KotshiApplicationJsonAdapterFactory

Parameters

useAdaptersForPrimitives

A flag to enable or disable the use of adapters on a module basis. Since using adapters is worse for performance don't enable it unless you need it. This flag can be overridden in each adapter using JsonSerializable.useAdaptersForPrimitives.

serializeNulls

Enable or disable null serialization for adapters in this factory. Only applied to adapters that don't specify an explicit value.

Properties

Link copied to clipboard
Link copied to clipboard