public final class PassThroughFromDocumentFieldValueConverter<F> extends Object implements FromDocumentFieldValueConverter<F,F>
| Constructor and Description |
|---|
PassThroughFromDocumentFieldValueConverter(Class<F> fieldType) |
| Modifier and Type | Method and Description |
|---|---|
F |
convert(F value,
FromDocumentFieldValueConvertContext context) |
boolean |
isCompatibleWith(FromDocumentFieldValueConverter<?,?> other) |
boolean |
isConvertedTypeAssignableTo(Class<?> superTypeCandidate)
Check whether converted values can be assigned to the given type.
|
public F convert(F value, FromDocumentFieldValueConvertContext context)
convert in interface FromDocumentFieldValueConverter<F,F>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).public boolean isConvertedTypeAssignableTo(Class<?> superTypeCandidate)
FromDocumentFieldValueConverter
This method is generally implemented like this:
return superTypeCandidate.isAssignableFrom( TheConvertedType.class ).
isConvertedTypeAssignableTo in interface FromDocumentFieldValueConverter<F,F>superTypeCandidate - A candidate type for assignment of converted values.true if the converted type V is a subtype of superTypeCandidate,
false otherwise.public boolean isCompatibleWith(FromDocumentFieldValueConverter<?,?> other)
isCompatibleWith in interface FromDocumentFieldValueConverter<F,F>other - Another ToDocumentFieldValueConverter, never null.true if the given object behaves exactly the same as this object,
i.e. its FromDocumentFieldValueConverter.isConvertedTypeAssignableTo(Class) and FromDocumentFieldValueConverter.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.