org.hibernate.search.elasticsearch.bridge.builtin.time.impl

## Class ElasticsearchTemporalAccessorStringBridge<T extends TemporalAccessor>

- java.lang.Object
- - org.hibernate.search.bridge.util.impl.EncodingStringBridge<T>
  - - org.hibernate.search.elasticsearch.bridge.builtin.time.impl.ElasticsearchTemporalAccessorStringBridge<T>

- All Implemented Interfaces:
    EncodingBridge, IgnoreAnalyzerBridge, StringBridge, TwoWayStringBridge
  Direct Known Subclasses:
    ElasticsearchInstantBridge, ElasticsearchLocalDateBridge, ElasticsearchLocalDateTimeBridge, ElasticsearchLocalTimeBridge, ElasticsearchMonthDayBridge, ElasticsearchOffsetDateTimeBridge, ElasticsearchOffsetTimeBridge, ElasticsearchYearBridge, ElasticsearchYearMonthBridge, ElasticsearchZonedDateTimeBridge

      public abstract class ElasticsearchTemporalAccessorStringBridge<T extends TemporalAccessor>
      extends EncodingStringBridge<T>
      implements TwoWayStringBridge, IgnoreAnalyzerBridge

  Base class for the conversion of `TemporalAccessor` to `String`.
  Author:
    Davide D'Alto, Yoann Rodiere

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract IllegalArgumentException` | `createInvalidIndexNullAsException(String indexNullAs, DateTimeException e)`
    `NumericFieldSettingsDescriptor.NumericEncodingType` | `getEncodingType()` Define the numeric encoding to use for the brdige.
    `String` | `objectToString(Object object)` Converts the object representation to a string.
    `protected T` | `parseIndexNullAs(String indexNullAs)` Parse the 'indexNullAs' string to an indexable value.
    `Object` | `stringToObject(String stringValue)` Convert the index string representation to an object.

    - ### Methods inherited from class org.hibernate.search.bridge.util.impl.EncodingStringBridge

      `createNullMarker`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### objectToString

          public String objectToString(Object object)

      Description copied from interface: `StringBridge`
      Converts the object representation to a string.
      Specified by:
        `objectToString` in interface `StringBridge`
      Parameters:
        `object` - The object to transform into a string representation.
      Returns:
        String representation of the given object to be stored in Lucene index. The return string must not be `null`. It can be empty though.

    - #### stringToObject

          public Object stringToObject(String stringValue)

      Description copied from interface: `TwoWayStringBridge`
      Convert the index string representation to an object.
      Specified by:
        `stringToObject` in interface `TwoWayStringBridge`
      Parameters:
        `stringValue` - The index value.
      Returns:
        Takes the string representation from the Lucene index and transforms it back into the original `Object`.

    - #### getEncodingType

          public NumericFieldSettingsDescriptor.NumericEncodingType getEncodingType()

      Description copied from interface: `EncodingBridge`
      Define the numeric encoding to use for the brdige.
      Specified by:
        `getEncodingType` in interface `EncodingBridge`
      Overrides:
        `getEncodingType` in class `EncodingStringBridge<T extends TemporalAccessor>`
      Returns:
        the encoding to use for this bridge, or `NumericFieldSettingsDescriptor.NumericEncodingType.UNKNOWN` if this bridge does not use numeric encoding.

    - #### parseIndexNullAs

          protected T parseIndexNullAs(String indexNullAs)
                                throws IllegalArgumentException

      Description copied from class: `EncodingStringBridge`
      Parse the 'indexNullAs' string to an indexable value.

      The required format does not have to be the same as the encoded format.

      Specified by:
        `parseIndexNullAs` in class `EncodingStringBridge<T extends TemporalAccessor>`
      Parameters:
        `indexNullAs` - The string to parse.
      Returns:
        The encoded value for the given string.
      Throws:
        `IllegalArgumentException` - If the given string does not match the required format.

    - #### createInvalidIndexNullAsException

          protected abstract IllegalArgumentException createInvalidIndexNullAsException(String indexNullAs,
                                                                                        DateTimeException e)

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved