Class ElasticsearchBooleanFieldCodec
- java.lang.Object
-
- org.hibernate.search.backend.elasticsearch.types.codec.impl.ElasticsearchBooleanFieldCodec
-
- All Implemented Interfaces:
ElasticsearchFieldCodec<Boolean>
public class ElasticsearchBooleanFieldCodec extends Object implements ElasticsearchFieldCodec<Boolean>
-
-
Field Summary
Fields Modifier and Type Field Description static ElasticsearchBooleanFieldCodecINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Booleandecode(com.google.gson.JsonElement element)BooleandecodeAggregationKey(com.google.gson.JsonElement key, com.google.gson.JsonElement keyAsString)Decodes the key returned by a term aggregation.com.google.gson.JsonElementencode(Boolean value)booleanisCompatibleWith(ElasticsearchFieldCodec<?> other)Determine whether another codec is compatible with this one, i.e.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.backend.elasticsearch.types.codec.impl.ElasticsearchFieldCodec
encodeForAggregation, encodeForMissing
-
-
-
-
Field Detail
-
INSTANCE
public static final ElasticsearchBooleanFieldCodec INSTANCE
-
-
Method Detail
-
encode
public com.google.gson.JsonElement encode(Boolean value)
- Specified by:
encodein interfaceElasticsearchFieldCodec<Boolean>
-
decode
public Boolean decode(com.google.gson.JsonElement element)
- Specified by:
decodein interfaceElasticsearchFieldCodec<Boolean>
-
decodeAggregationKey
public Boolean decodeAggregationKey(com.google.gson.JsonElement key, com.google.gson.JsonElement keyAsString)
Description copied from interface:ElasticsearchFieldCodecDecodes the key returned by a term aggregation.- Specified by:
decodeAggregationKeyin interfaceElasticsearchFieldCodec<Boolean>- 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 aJsonPrimitivecontaining a string.- Returns:
- The decoded term.
-
isCompatibleWith
public boolean isCompatibleWith(ElasticsearchFieldCodec<?> other)
Description copied from interface:ElasticsearchFieldCodecDetermine 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.- Specified by:
isCompatibleWithin interfaceElasticsearchFieldCodec<Boolean>- Parameters:
other- AnotherElasticsearchFieldCodec, nevernull.- Returns:
trueif the given codec is compatible.falseotherwise, or when in doubt.
-
-