org.hibernate.search.bridge.builtin.impl

## Class NullEncodingTwoWayFieldBridge

- java.lang.Object
- - org.hibernate.search.bridge.builtin.impl.NullEncodingTwoWayFieldBridge

- All Implemented Interfaces:
    FieldBridge, StringBridge, TwoWayFieldBridge, BridgeAdaptor

      public class NullEncodingTwoWayFieldBridge
      extends Object
      implements TwoWayFieldBridge, BridgeAdaptor

  Author:
    Hardy Ferentschik

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NullEncodingTwoWayFieldBridge(TwoWayFieldBridge fieldBridge, NullMarkerCodec nullTokenCodec)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Query` | `buildNullQuery(String fieldName)`
    `Object` | `get(String name, Document document)` Build the element object from the `Document`
    `String` | `objectToString(Object object)` Convert the object representation to a string.
    `void` | `set(String name, Object value, Document document, LuceneOptions luceneOptions)` Manipulate the document to index the given value.
    `<T> T` | `unwrap(Class<T> bridgeClass)` Return an object of the specified type to allow access to specific bridge interfaces.

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

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

- - ### Constructor Detail

    - #### NullEncodingTwoWayFieldBridge

          public NullEncodingTwoWayFieldBridge(TwoWayFieldBridge fieldBridge,
                                               NullMarkerCodec nullTokenCodec)

  - ### Method Detail

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

    - #### objectToString

          public String objectToString(Object object)

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

    - #### 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`
      Returns:
        An instance of the specified class, or `null` if there is none.

    - #### set

          public void set(String name,
                          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:
        `name` - 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.

    - #### buildNullQuery

          public Query buildNullQuery(String fieldName)

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