Class DefaultIdentifierBindingContext<I>
- java.lang.Object
-
- org.hibernate.search.mapper.pojo.bridge.binding.impl.DefaultIdentifierBindingContext<I>
-
- All Implemented Interfaces:
BindingContext,IdentifierBindingContext<I>
public class DefaultIdentifierBindingContext<I> extends Object implements IdentifierBindingContext<I>
-
-
Constructor Summary
Constructors Constructor Description DefaultIdentifierBindingContext(BeanResolver beanResolver, PojoBootstrapIntrospector introspector, Optional<IndexedEntityBindingContext> indexedEntityBindingContext, PojoTypeModel<I> valueTypeModel, Map<String,Object> params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundIdentifierBridge<I>applyBinder(IdentifierBinder binder)BeanResolverbeanResolver()<I2> voidbridge(Class<I2> expectedValueType, BeanHolder<? extends IdentifierBridge<I2>> bridgeHolder)Sets the bridge implementing the value/index binding.<I2> voidbridge(Class<I2> expectedValueType, IdentifierBridge<I2> bridge)Sets the bridge implementing the value/index binding.PojoModelValue<I>bridgedElement()Objectparam(String name)Optional<Object>paramOptional(String name)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.mapper.pojo.bridge.binding.BindingContext
beanResolver, param, paramOptional
-
-
-
-
Constructor Detail
-
DefaultIdentifierBindingContext
public DefaultIdentifierBindingContext(BeanResolver beanResolver, PojoBootstrapIntrospector introspector, Optional<IndexedEntityBindingContext> indexedEntityBindingContext, PojoTypeModel<I> valueTypeModel, Map<String,Object> params)
-
-
Method Detail
-
bridge
public <I2> void bridge(Class<I2> expectedValueType, IdentifierBridge<I2> bridge)
Description copied from interface:IdentifierBindingContextSets the bridge implementing the value/index binding.- Specified by:
bridgein interfaceIdentifierBindingContext<I>- Type Parameters:
I2- The type of identifiers expected by the given bridge.- Parameters:
expectedValueType- The type of identifiers expected by the given bridge. Hibernate Search will check that these expectations are met, and throw an exception if they are not.bridge- The bridge to use at runtime to convert between the POJO identifier and the document identifier.
-
bridge
public <I2> void bridge(Class<I2> expectedValueType, BeanHolder<? extends IdentifierBridge<I2>> bridgeHolder)
Description copied from interface:IdentifierBindingContextSets the bridge implementing the value/index binding.- Specified by:
bridgein interfaceIdentifierBindingContext<I>- Type Parameters:
I2- The type of identifiers expected by the given bridge.- Parameters:
expectedValueType- The type of values expected by the given bridge. Hibernate Search will check that these expectations are met, and throw an exception if they are not.bridgeHolder- ABeanHoldercontaining the bridge to use at runtime to convert between the POJO property value and the index field value. UseBeanHolder.of(Object)if you don't need any particular closing behavior.
-
bridgedElement
public PojoModelValue<I> bridgedElement()
- Specified by:
bridgedElementin interfaceIdentifierBindingContext<I>- Returns:
- An entry point allowing to inspect the type of values that will be passed to this bridge.
-
applyBinder
public BoundIdentifierBridge<I> applyBinder(IdentifierBinder binder)
-
beanResolver
public BeanResolver beanResolver()
- Specified by:
beanResolverin interfaceBindingContext- Returns:
- A bean provider, allowing the retrieval of beans, including CDI/Spring DI beans when in the appropriate environment.
-
param
public Object param(String name)
- Specified by:
paramin interfaceBindingContext- Parameters:
name- The name of the param- Returns:
- Get a param defined for the binder by the given name
-
paramOptional
public Optional<Object> paramOptional(String name)
- Specified by:
paramOptionalin interfaceBindingContext- Parameters:
name- The name of the param- Returns:
- Get an optional param defined for the binder by the given name, a param having such name may either exist or not.
-
-