V - The type of values on the POJO side of the bridge.F - The type of raw index field values, on the index side of the bridge.public interface ValueBridge<V,F> extends AutoCloseable
V and an index field of type F.
The ValueBridge interface is a simpler version of PropertyBridge,
in which no property metadata is available
and a given input value can only be mapped to a single field, in particular.
| Modifier and Type | Method and Description |
|---|---|
default void |
close()
Close any resource before the bridge is discarded.
|
default V |
fromIndexedValue(F value,
ValueBridgeFromIndexedValueContext context)
Transform the given indexed field value to the corresponding POJO-extracted value.
|
default boolean |
isCompatibleWith(ValueBridge<?,?> other) |
default F |
parse(String value)
Parse an input String to the raw index field value.
|
F |
toIndexedValue(V value,
ValueBridgeToIndexedValueContext context)
Transform the given POJO-extracted value into the value of the indexed field.
|
F toIndexedValue(V value, ValueBridgeToIndexedValueContext context)
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).default V fromIndexedValue(F value, ValueBridgeFromIndexedValueContext context)
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).UnsupportedOperationException - If conversion is not supported.default F parse(String value)
value - The value to parse.RuntimeException - If the value cannot be parsed to the raw index field value.default boolean isCompatibleWith(ValueBridge<?,?> other)
other - Another ValueBridge, never null.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.default void close()
close in interface AutoCloseableCopyright © 2006-2020 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.