org.hibernate.search.bridge.builtin

## Class StringBridge

- java.lang.Object
- - org.hibernate.search.bridge.builtin.StringBridge

- All Implemented Interfaces:
    StringBridge, TwoWayStringBridge

      public class StringBridge
      extends Object
      implements TwoWayStringBridge

  Bridge a `String` to a string.
  Author:
    Emmanuel Bernard

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static StringBridge` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringBridge()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `objectToString(Object object)` Converts the object representation to a string.
    `Object` | `stringToObject(String stringValue)` Convert the index string representation to an object.

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

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

- - ### Field Detail

    - #### INSTANCE

          public static final StringBridge INSTANCE

  - ### Constructor Detail

    - #### StringBridge

          public StringBridge()

  - ### Method Detail

    - #### 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`.

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

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