Class GeometryJsonConverter
java.lang.Object
io.micronaut.data.model.runtime.convert.GeometryJsonConverter
- All Implemented Interfaces:
AttributeConverter<Geometry,String>
@Singleton
public final class GeometryJsonConverter
extends Object
implements AttributeConverter<Geometry,String>
Converts
Geometry values to and from their GeoJSON string representation.
This converter is used for geo model types that are persisted as JSON text and supports
all Micronaut Data geometry implementations, including nested GeometryCollection
values.
- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable GeometryconvertToEntityValue(@Nullable String persistedValue, io.micronaut.core.convert.ConversionContext context) Converts the persisted value to the entity value.@Nullable StringconvertToPersistedValue(@Nullable Geometry entityValue, io.micronaut.core.convert.ConversionContext context) Converts the entity value to the persisted value.
-
Method Details
-
convertToPersistedValue
public @Nullable String convertToPersistedValue(@Nullable Geometry entityValue, io.micronaut.core.convert.ConversionContext context) Description copied from interface:AttributeConverterConverts the entity value to the persisted value.- Specified by:
convertToPersistedValuein interfaceAttributeConverter<Geometry,String> - Parameters:
entityValue- The entity valuecontext- The conversion context.- Returns:
- the persisted value
-
convertToEntityValue
public @Nullable Geometry convertToEntityValue(@Nullable String persistedValue, io.micronaut.core.convert.ConversionContext context) Description copied from interface:AttributeConverterConverts the persisted value to the entity value.- Specified by:
convertToEntityValuein interfaceAttributeConverter<Geometry,String> - Parameters:
persistedValue- The persisted valuecontext- The conversion context.- Returns:
- the entity value
-