Class AbstractElasticsearchJavaTimeFieldCodec<T extends TemporalAccessor>

    • Constructor Detail

      • AbstractElasticsearchJavaTimeFieldCodec

        public AbstractElasticsearchJavaTimeFieldCodec​(DateTimeFormatter delegate)
    • Method Detail

      • encodeForMissing

        public com.google.gson.JsonElement encodeForMissing​(T value)
        A different encoding is required for provided missing Java time values. See HSEARCH-3255.
        Specified by:
        encodeForMissing in interface ElasticsearchFieldCodec<T extends TemporalAccessor>
        Parameters:
        value - to encode
        Returns:
        a JsonElement containing the long scalar value, if value is not null.
      • decodeAggregationKey

        public T decodeAggregationKey​(com.google.gson.JsonElement key,
                                      com.google.gson.JsonElement keyAsString)
        Description copied from interface: ElasticsearchFieldCodec
        Decodes the key returned by a term aggregation.
        Specified by:
        decodeAggregationKey in interface ElasticsearchFieldCodec<T extends TemporalAccessor>
        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.
      • nullUnsafeFormat

        protected String nullUnsafeFormat​(T value)
      • nullUnsafeParse

        protected abstract T nullUnsafeParse​(String stringValue)
      • nullUnsafeScalar

        protected abstract Long nullUnsafeScalar​(T value)