Interface AttributeConverter<X,Y>
-
- Type Parameters:
X- The entity value typeY- The persisted value type
@Indexed(AttributeConverter.class) public interface AttributeConverter<X,Y>
The attribute converter is used for converting mapped entity value to the persisted value and back.- Since:
- 3.1
- Author:
- Denis Stepanov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description XconvertToEntityValue(Y persistedValue, io.micronaut.core.convert.ConversionContext context)Converts the persisted value to the entity value.YconvertToPersistedValue(X entityValue, io.micronaut.core.convert.ConversionContext context)Converts the entity value to the persisted value.
-
-
-
Method Detail
-
convertToPersistedValue
@Nullable Y convertToPersistedValue(@Nullable X entityValue, @NonNull io.micronaut.core.convert.ConversionContext context)
Converts the entity value to the persisted value.- Parameters:
entityValue- The entity valuecontext- The conversion context.- Returns:
- the persisted value
-
convertToEntityValue
@Nullable X convertToEntityValue(@Nullable Y persistedValue, @NonNull io.micronaut.core.convert.ConversionContext context)
Converts the persisted value to the entity value.- Parameters:
persistedValue- The persisted valuecontext- The conversion context.- Returns:
- the entity value
-
-