org.hibernate.search.bridge.util.impl

## Class EncodingStringBridge<T>

- java.lang.Object
- - org.hibernate.search.bridge.util.impl.EncodingStringBridge<T>

- All Implemented Interfaces:
    EncodingBridge, StringBridge
  Direct Known Subclasses:
    ElasticsearchCalendarBridge, ElasticsearchDateBridge, ElasticsearchTemporalAccessorStringBridge

      public abstract class EncodingStringBridge<T>
      extends Object
      implements EncodingBridge, StringBridge

  A base class for `EncodingBridge`s that encode values as Strings using a specific format.
  Author:
    Yoann Rodiere

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EncodingStringBridge()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `NullMarker` | `createNullMarker(String indexNullAs)`
    `NumericFieldSettingsDescriptor.NumericEncodingType` | `getEncodingType()` Define the numeric encoding to use for the brdige.
    `protected abstract T` | `parseIndexNullAs(String indexNullAs)` Parse the 'indexNullAs' string to an indexable value.

    - ### 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.bridge.StringBridge

      `objectToString`

- - ### Constructor Detail

    - #### EncodingStringBridge

          public EncodingStringBridge()

  - ### Method Detail

    - #### 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`
      Returns:
        the encoding to use for this bridge, or `NumericFieldSettingsDescriptor.NumericEncodingType.UNKNOWN` if this bridge does not use numeric encoding.

    - #### parseIndexNullAs

          protected abstract T parseIndexNullAs(String indexNullAs)
                                         throws IllegalArgumentException

      Parse the 'indexNullAs' string to an indexable value.

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

      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.

    - #### createNullMarker

          public NullMarker createNullMarker(String indexNullAs)
                                      throws IllegalArgumentException

      Specified by:
        `createNullMarker` in interface `EncodingBridge`
      Parameters:
        `indexNullAs` - The value of `Field.indexNullAs()`.
      Returns:
        The marker to use when a value is missing.
      Throws:
        `IllegalArgumentException` - If `indexNullAs` cannot be encoded in the required format.

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