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

org.http4k.connect.kafka.schemaregistry.KotshiSchemaRegistryJsonAdapterFactory.kt Maven / Gradle / Ivy

// Code generated by Kotshi. Do not edit.
@file:Suppress(
  "EXPERIMENTAL_IS_NOT_ENABLED",
  "REDUNDANT_PROJECTION",
)

package org.http4k.connect.kafka.schemaregistry

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types.getRawType
import java.lang.Class
import java.lang.reflect.Type
import kotlin.Annotation
import kotlin.OptIn
import kotlin.Suppress
import kotlin.collections.Set
import org.http4k.connect.kafka.schemaregistry.action.KotshiRegisteredSchemaVersionJsonAdapter
import org.http4k.connect.kafka.schemaregistry.action.RegisteredSchemaVersion
import se.ansman.kotshi.InternalKotshiApi

@OptIn(InternalKotshiApi::class)
internal object KotshiSchemaRegistryJsonAdapterFactory : JsonAdapter.Factory {
  override fun create(
    type: Type,
    annotations: Set,
    moshi: Moshi,
  ): JsonAdapter<*>? {
    val rawType: Class<*> = getRawType(type)
    if (annotations.isNotEmpty()) return null

    return when (rawType) {
      RegisteredSchemaVersion::class.java ->
          KotshiRegisteredSchemaVersionJsonAdapter(
            moshi = moshi
          )
      else -> null
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy