org.hibernate.search.bridge

## Interface TwoWayFieldBridge

- All Superinterfaces:
    FieldBridge, StringBridge
  All Known Implementing Classes:
    DurationBridge, ElasticsearchCalendarBridge, ElasticsearchDateBridge, InstantBridge, NullEncodingTwoWayFieldBridge, NumericEncodingCalendarBridge, NumericEncodingDateBridge, NumericFieldBridge, StringEncodingCalendarBridge, StringEncodingDateBridge, TwoWayString2FieldBridgeAdaptor, TwoWayString2FieldBridgeIgnoreAnalyzerAdaptor, YearBridge

      public interface TwoWayFieldBridge
      extends FieldBridge, StringBridge

  A `FieldBridge` able to convert the index representation back into an object without losing information. Any bridge expected to process a document id should implement this interface.
  Author:
    Emmanuel Bernard

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `get(String name, Document document)` Build the element object from the `Document`
    `String` | `objectToString(Object object)` Convert the object representation to a string.

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

      `set`

- - ### Method Detail

    - #### get

          Object get(String name,
                     Document document)

      Build the element object from the `Document`
      Parameters:
        `name` - field name
        `document` - document
      Returns:
        The return value is the entity property value.

    - #### objectToString

          String objectToString(Object object)

      Convert the object representation to a string.
      Specified by:
        `objectToString` in interface `StringBridge`
      Parameters:
        `object` - The object to index.
      Returns:
        string (index) representation of the specified object. Must not be `null`, but can be empty.

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