org.hibernate.search.bridge.util.impl

## Class TwoWayString2FieldBridgeAdaptor

- java.lang.Object
- - org.hibernate.search.bridge.util.impl.String2FieldBridgeAdaptor
  - - org.hibernate.search.bridge.util.impl.TwoWayString2FieldBridgeAdaptor

- All Implemented Interfaces:
    AppliedOnTypeAwareBridge, FieldBridge, StringBridge, TwoWayFieldBridge, BridgeAdaptor
  Direct Known Subclasses:
    TwoWayString2FieldBridgeIgnoreAnalyzerAdaptor

      public class TwoWayString2FieldBridgeAdaptor
      extends String2FieldBridgeAdaptor
      implements TwoWayFieldBridge

  Bridge to use a TwoWayStringBridge as a TwoWayFieldBridge
  Author:
    Emmanuel Bernard

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TwoWayString2FieldBridgeAdaptor(TwoWayStringBridge stringBridge)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `get(String name, Document document)` Build the element object from the `Document`
    `String` | `objectToString(Object object)` Converts the object representation to a string.
    `String` | `toString()`
    `<T> T` | `unwrap(Class<T> bridgeClass)` Return an object of the specified type to allow access to specific bridge interfaces.

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

      `set, setAppliedOnType`

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

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

    - ### Methods inherited from interface org.hibernate.search.bridge.FieldBridge

      `set`

- - ### Constructor Detail

    - #### TwoWayString2FieldBridgeAdaptor

          public TwoWayString2FieldBridgeAdaptor(TwoWayStringBridge stringBridge)

  - ### 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`
      Specified by:
        `objectToString` in interface `TwoWayFieldBridge`
      Overrides:
        `objectToString` in class `String2FieldBridgeAdaptor`
      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.

    - #### get

          public Object get(String name,
                            Document document)

      Description copied from interface: `TwoWayFieldBridge`
      Build the element object from the `Document`
      Specified by:
        `get` in interface `TwoWayFieldBridge`
      Parameters:
        `name` - field name
        `document` - document
      Returns:
        The return value is the entity property value.

    - #### unwrap

          public <T> T unwrap(Class<T> bridgeClass)

      Description copied from interface: `BridgeAdaptor`
      Return an object of the specified type to allow access to specific bridge interfaces.

      If no adapted bridge matches this type, `null` is returned.

      Specified by:
        `unwrap` in interface `BridgeAdaptor`
      Overrides:
        `unwrap` in class `String2FieldBridgeAdaptor`
      Returns:
        An instance of the specified class, or `null` if there is none.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `String2FieldBridgeAdaptor`

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