F
- The type of the "raw" field.public final class UserIndexFieldConverter<F> extends Object
Used to convert values passed to the predicate/sort DSL to the "backend" type, and also to convert projected values to the "user" type.
Modifier and Type | Method and Description |
---|---|
F |
convertDslToIndex(Object value,
ToIndexFieldValueConvertContext context) |
Object |
convertIndexToProjection(F indexValue,
FromIndexFieldValueConvertContext context) |
boolean |
isConvertDslToIndexCompatibleWith(UserIndexFieldConverter<?> other)
Determine whether another converter's
convertDslToIndex(Object, ToIndexFieldValueConvertContext)
method is compatible with this one's,
i.e. |
boolean |
isConvertIndexToProjectionCompatibleWith(UserIndexFieldConverter<?> other)
Determine whether another converter's
convertIndexToProjection(Object, FromIndexFieldValueConvertContext)
method is compatible with this one's,
i.e. |
boolean |
isProjectionCompatibleWith(Class<?> projectionType)
Determine whether the given projection type is compatible with this converter.
|
String |
toString() |
public F convertDslToIndex(Object value, ToIndexFieldValueConvertContext context)
public Object convertIndexToProjection(F indexValue, FromIndexFieldValueConvertContext context)
public boolean isConvertDslToIndexCompatibleWith(UserIndexFieldConverter<?> other)
convertDslToIndex(Object, ToIndexFieldValueConvertContext)
method is compatible with this one's,
i.e. the method is guaranteed to always return the same value as this converter's when given the same input.
Note: this method is separate from Object.equals(Object)
because it might return true
for two different objects,
e.g. two objects that implement convertIndexToProjection(Object, FromIndexFieldValueConvertContext)
differently,
but still implement convertDslToIndex(Object, ToIndexFieldValueConvertContext)
in a compatible way.
other
- Another UserIndexFieldConverter
.true
if the given converter's
convertDslToIndex(Object, ToIndexFieldValueConvertContext)
method is compatible.
false
otherwise, or when in doubt.public boolean isConvertIndexToProjectionCompatibleWith(UserIndexFieldConverter<?> other)
convertIndexToProjection(Object, FromIndexFieldValueConvertContext)
method is compatible with this one's,
i.e. the method is guaranteed to always return the same value as this converter's when given the same input.
Note: this method is separate from Object.equals(Object)
because it might return true
for two different objects,
e.g. two objects that implement convertDslToIndex(Object, ToIndexFieldValueConvertContext)
differently,
but still implement convertIndexToProjection(Object, FromIndexFieldValueConvertContext)
in a compatible way.
other
- Another UserIndexFieldConverter
.true
if the given converter's
convertIndexToProjection(Object, FromIndexFieldValueConvertContext)
method is compatible.
false
otherwise, or when in doubt.public boolean isProjectionCompatibleWith(Class<?> projectionType)
projectionType
- The projection type.true
if the given projection type is compatible. false
otherwiseCopyright © 2006-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.