F
- The type of source, index field values.V
- The type of target values.public interface FromDocumentFieldValueConverter<F,V>
Modifier and Type | Method and Description |
---|---|
V |
convert(F value,
FromDocumentFieldValueConvertContext context) |
default boolean |
isCompatibleWith(FromDocumentFieldValueConverter<?,?> other) |
boolean |
isConvertedTypeAssignableTo(Class<?> superTypeCandidate)
Check whether converted values can be assigned to the given type.
|
boolean isConvertedTypeAssignableTo(Class<?> superTypeCandidate)
This method is generally implemented like this:
return superTypeCandidate.isAssignableFrom( TheConvertedType.class )
.
superTypeCandidate
- A candidate type for assignment of converted values.true
if the converted type V
is a subtype of superTypeCandidate
,
false
otherwise.V convert(F value, FromDocumentFieldValueConvertContext context)
value
- The index field value to convert.context
- A context that can be
extended
to a more useful type, giving access to such things as a Hibernate ORM Session (if using the Hibernate ORM mapper).default boolean isCompatibleWith(FromDocumentFieldValueConverter<?,?> other)
other
- Another ToDocumentFieldValueConverter
, never null
.true
if the given object behaves exactly the same as this object,
i.e. its isConvertedTypeAssignableTo(Class)
and convert(Object, FromDocumentFieldValueConvertContext)
methods are guaranteed to always return the same value as this object's
when given the same input. false
otherwise, or when in doubt.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.