Class GeometryWktConverter

java.lang.Object
io.micronaut.data.model.runtime.convert.GeometryWktConverter
All Implemented Interfaces:
AttributeConverter<Geometry,String>

@Singleton public final class GeometryWktConverter extends Object implements AttributeConverter<Geometry,String>
Converts Geometry values to and from their Well-Known Text (WKT) representation.

This converter supports the Micronaut Data geo model hierarchy and handles nested structures such as GeometryCollection values during formatting and parsing.

Since:
5.0
  • Constructor Details

    • GeometryWktConverter

      public GeometryWktConverter()
  • Method Details

    • convertToPersistedValue

      public @Nullable String convertToPersistedValue(@Nullable Geometry entityValue, io.micronaut.core.convert.ConversionContext context)
      Description copied from interface: AttributeConverter
      Converts the entity value to the persisted value.
      Specified by:
      convertToPersistedValue in interface AttributeConverter<Geometry,String>
      Parameters:
      entityValue - The entity value
      context - 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: AttributeConverter
      Converts the persisted value to the entity value.
      Specified by:
      convertToEntityValue in interface AttributeConverter<Geometry,String>
      Parameters:
      persistedValue - The persisted value
      context - The conversion context.
      Returns:
      the entity value