Class ElasticsearchBooleanFieldCodec

java.lang.Object
org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchFieldCodec<Boolean>
org.hibernate.search.backend.elasticsearch.types.codec.impl.ElasticsearchBooleanFieldCodec
All Implemented Interfaces:
ElasticsearchFieldCodec<Boolean>

public final class ElasticsearchBooleanFieldCodec extends AbstractElasticsearchFieldCodec<Boolean>
  • Constructor Details

    • ElasticsearchBooleanFieldCodec

      public ElasticsearchBooleanFieldCodec(com.google.gson.Gson gson)
  • Method Details

    • encode

      public com.google.gson.JsonElement encode(Boolean value)
    • decode

      public Boolean decode(com.google.gson.JsonElement element)
    • decodeAggregationKey

      public Boolean decodeAggregationKey(com.google.gson.JsonElement key, com.google.gson.JsonElement keyAsString)
      Description copied from interface: ElasticsearchFieldCodec
      Decodes the key returned by a term aggregation.
      Parameters:
      key - The "key" property returned by the aggregation. May be a number, a string, ... depending on the field type.
      keyAsString - The "key_as_string" property returned by the term aggregation. Either null or a JsonPrimitive containing a string.
      Returns:
      The decoded term.
    • isCompatibleWith

      public boolean isCompatibleWith(ElasticsearchFieldCodec<?> other)
      Description copied from interface: ElasticsearchFieldCodec
      Determine whether another codec is compatible with this one, i.e. whether it will encode/decode the information to/from the document in a compatible way.
      Parameters:
      other - Another ElasticsearchFieldCodec, never null.
      Returns:
      true if the given codec is compatible. false otherwise, or when in doubt.
    • fromJsonElementToString

      public String fromJsonElementToString(com.google.gson.JsonElement value)
      Specified by:
      fromJsonElementToString in interface ElasticsearchFieldCodec<Boolean>
      Overrides:
      fromJsonElementToString in class AbstractElasticsearchFieldCodec<Boolean>