Class String2FieldBridgeAdaptor

java.lang.Object
org.hibernate.search.bridge.String2FieldBridgeAdaptor
All Implemented Interfaces:
FieldBridge, StringBridge
Direct Known Subclasses:
TwoWayString2FieldBridgeAdaptor

public class String2FieldBridgeAdaptor extends Object implements FieldBridge, StringBridge
Bridge to use a StringBridge as a FieldBridge.
  • Constructor Details

    • String2FieldBridgeAdaptor

      public String2FieldBridgeAdaptor(StringBridge stringBridge)
  • Method Details

    • 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. {code} String fieldValue = convertToString(value); luceneOptions.addFieldToDocument(name, fieldValue, document); {code}

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