org.hibernate.search.spatial

## Class SpatialFieldBridge

- java.lang.Object
- - org.hibernate.search.spatial.SpatialFieldBridge

- All Implemented Interfaces:
    AppliedOnTypeAwareBridge, FieldBridge, MetadataProvidingFieldBridge
  Direct Known Subclasses:
    SpatialFieldBridgeByHash, SpatialFieldBridgeByRange

      public abstract class SpatialFieldBridge
      extends Object
      implements MetadataProvidingFieldBridge, AppliedOnTypeAwareBridge

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `latitudeField`
    `protected String` | `latitudeIndexedFieldName`
    `protected String` | `longitudeField`
    `protected String` | `longitudeIndexedFieldName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpatialFieldBridge()`
    `SpatialFieldBridge(String latitudeField, String longitudeField)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `capitalize(String name)`
    `void` | `configureFieldMetadata(String name, FieldMetadataBuilder builder)` Allows this bridge to expose meta-data about the fields it creates.
    `protected Double` | `getLatitude(Object value)`
    `protected Double` | `getLongitude(Object value)`
    `abstract void` | `set(String name, Object value, Document document, LuceneOptions luceneOptions)` Manipulate the document to index the given value.
    `void` | `setAppliedOnType(Class<?> returnType)` Set the return type of the bridge (the type of the field linked to the bridge).

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

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

- - ### Field Detail

    - #### latitudeField

          protected String latitudeField

    - #### longitudeField

          protected String longitudeField

    - #### latitudeIndexedFieldName

          protected String latitudeIndexedFieldName

    - #### longitudeIndexedFieldName

          protected String longitudeIndexedFieldName

  - ### Constructor Detail

    - #### SpatialFieldBridge

          public SpatialFieldBridge()

    - #### SpatialFieldBridge

          public SpatialFieldBridge(String latitudeField,
                                    String longitudeField)

  - ### Method Detail

    - #### setAppliedOnType

          public void setAppliedOnType(Class<?> returnType)

      Description copied from interface: `AppliedOnTypeAwareBridge`
      Set the return type of the bridge (the type of the field linked to the bridge).
      Specified by:
        `setAppliedOnType` in interface `AppliedOnTypeAwareBridge`
      Parameters:
        `returnType` - return type

    - #### set

          public abstract 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.

    - #### getLatitude

          protected Double getLatitude(Object value)

    - #### configureFieldMetadata

          public void configureFieldMetadata(String name,
                                             FieldMetadataBuilder builder)

      Description copied from interface: `MetadataProvidingFieldBridge`
      Allows this bridge to expose meta-data about the fields it creates.
      Specified by:
        `configureFieldMetadata` in interface `MetadataProvidingFieldBridge`
      Parameters:
        `name` - The default field name; Should be used consistently with `FieldBridge.set(String, Object, org.apache.lucene.document.Document, LuceneOptions)`.
        `builder` - Builder for exposing field-related meta-data

    - #### getLongitude

          protected Double getLongitude(Object value)

    - #### capitalize

          public static String capitalize(String name)

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