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

value.property.AvroProperty.kt Maven / Gradle / Ivy

package io.toolisticon.kotlin.avro.value.property

import io.toolisticon.kotlin.avro.value.ObjectProperties
import org.apache.avro.JsonProperties

interface AvroProperty {
  val key: String
}

fun interface AvroPropertySupplier {
  fun from(properties: ObjectProperties) : T
  fun from(jsonProperties: JsonProperties?) : T = from(ObjectProperties.ofNullable(jsonProperties))
}

/**
 * Extracts list of [JavaAnnotationProperty] from [ObjectProperties]. Defaults to empty list.
 *
 * This always returns a list, in case the definition in json is a single string, the list only contains one element.
 */
val ObjectProperties.javaAnnotations: List get() = JavaAnnotationProperty.from(this)

val ObjectProperties.meta get() = AvroMetaDataProperty.from(this)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy