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

com.sksamuel.elastic4s.FieldValue.scala Maven / Gradle / Ivy

There is a newer version: 8.15.1
Show newest version
package com.sksamuel.elastic4s

trait FieldValue

case class NullFieldValue(name: String)                           extends FieldValue
case class ArrayFieldValue(name: String, values: Seq[FieldValue]) extends FieldValue

case class SimpleFieldValue(name: Option[String], value: Any) extends FieldValue

object SimpleFieldValue {
  def apply(name: String, value: Any): SimpleFieldValue = apply(Some(name), value)
  def apply(value: Any): SimpleFieldValue               = apply(None, value)
}

case class NestedFieldValue(name: Option[String], values: Seq[FieldValue]) extends FieldValue

object NestedFieldValue {
  def apply(name: String, values: Seq[FieldValue]): NestedFieldValue = apply(Some(name), values)
  def apply(values: Seq[FieldValue]): NestedFieldValue               = apply(None, values)
}

trait FieldValueWriter[T <: FieldValue] {
  def write(value: T): Unit
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy