Interface ValueBridge<V,​F>

    • Method Detail

      • toIndexedValue

        F toIndexedValue​(V value,
                         ValueBridgeToIndexedValueContext context)
        Transform the given POJO-extracted value into the value of the indexed field.
        Parameters:
        value - The POJO-extracted value to be transformed.
        context - A context that can be extended to a more useful type, giving access to such things as a Hibernate ORM SessionFactory (if using the Hibernate ORM mapper).
        Returns:
        The value of the indexed field.
      • fromIndexedValue

        default V fromIndexedValue​(F value,
                                   ValueBridgeFromIndexedValueContext context)
        Transform the given indexed field value to the corresponding POJO-extracted value.
        Parameters:
        value - The value of the indexed field to be transformed.
        context - A context that can be extended to a more useful type, giving access to such things as a Hibernate ORM SessionFactory (if using the Hibernate ORM mapper).
        Returns:
        The POJO-extracted value.
        Throws:
        UnsupportedOperationException - If conversion is not supported.
      • parse

        default F parse​(String value)
        Parse an input String to the raw index field value.
        Parameters:
        value - The value to parse.
        Returns:
        The raw index field value.
        Throws:
        RuntimeException - If the value cannot be parsed to the raw index field value.
      • isCompatibleWith

        default boolean isCompatibleWith​(ValueBridge<?,​?> other)
        Parameters:
        other - Another ValueBridge, never null.
        Returns:
        true if the given object is also a ValueBridge that behaves exactly the same as this object, i.e. its toIndexedValue(Object, ValueBridgeToIndexedValueContext) method is guaranteed to accept the same values as this object's and to always return the same value as this object's when given the same input. false otherwise, or when in doubt.
      • close

        default void close()
        Close any resource before the bridge is discarded.
        Specified by:
        close in interface AutoCloseable