org.hibernate.search.bridge.builtin

## Class IterableBridge

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

- All Implemented Interfaces:
    ContainerBridge, FieldBridge
  Direct Known Subclasses:
    BuiltinIterableBridge

      public class IterableBridge
      extends Object
      implements FieldBridge, ContainerBridge

  Each entry (`null included`) of an `Iterable` object is indexed using the specified `FieldBridge`.
  A `null` `Iterable` object is not indexed.
  Author:
    Davide D'Alto

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IterableBridge(FieldBridge bridge)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldBridge` | `getElementBridge()`
    `void` | `set(String fieldName, Object value, Document document, LuceneOptions luceneOptions)` Manipulate the document to index the given value.

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

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

- - ### Constructor Detail

    - #### IterableBridge

          public IterableBridge(FieldBridge bridge)

      Parameters:
        `bridge` - the `FieldBridge` used for each entry of the `Iterable` object.

  - ### Method Detail

    - #### set

          public void set(String fieldName,
                          Object value,
                          Document document,
                          LuceneOptions luceneOptions)

      Description copied from interface: `FieldBridge`
      Manipulate the document to index the given value.

      A common implementation is to add a Field with the given `name` to `document` following the parameters `luceneOptions` if the `value` is not `null`.

           String fieldValue = convertToString(value);
           luceneOptions.addFieldToDocument(name, fieldValue, document);

      Specified by:
        `set` in interface `FieldBridge`
      Parameters:
        `fieldName` - The field to add to the Lucene document
        `value` - The actual value to index
        `document` - The Lucene document into which we want to index the value.
        `luceneOptions` - Contains the parameters used for adding `value` to the Lucene document.

    - #### getElementBridge

          public FieldBridge getElementBridge()

      Specified by:
        `getElementBridge` in interface `ContainerBridge`
      Returns:
        the field bridge used for the elements of the container

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