Class PostgisCodec

  • All Implemented Interfaces:
    Codec<org.locationtech.jts.geom.Geometry>

    @Alpha
    final class PostgisCodec
    extends java.lang.Object
    implements Codec<org.locationtech.jts.geom.Geometry>
    • Constructor Summary

      Constructors 
      Constructor Description
      PostgisCodec()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static org.locationtech.jts.geom.Geometry deserialize​(byte[] bytes)
      Deserializes a geometry in the WKB format.
      java.util.function.Function<org.locationtech.jts.geom.Geometry,​Argument> getArgumentFunction()
      Returns a Function that creates an Argument to map an attribute value onto the database column.
      ColumnMapper<org.locationtech.jts.geom.Geometry> getColumnMapper()
      Returns a ColumnMapper that creates an attribute value from a database column.
      private static byte[] hexStringToByteArray​(java.lang.String s)  
      private static byte[] serialize​(org.locationtech.jts.geom.Geometry geometry)
      Serializes a geometry in the WKB format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PostgisCodec

        PostgisCodec()
    • Method Detail

      • getArgumentFunction

        public java.util.function.Function<org.locationtech.jts.geom.Geometry,​Argument> getArgumentFunction()
        Description copied from interface: Codec
        Returns a Function that creates an Argument to map an attribute value onto the database column.

        Either this method or Codec.getArgumentFunction(ConfigRegistry) must be implemented.

        Specified by:
        getArgumentFunction in interface Codec<org.locationtech.jts.geom.Geometry>
      • serialize

        private static byte[] serialize​(org.locationtech.jts.geom.Geometry geometry)
        Serializes a geometry in the WKB format.
        Parameters:
        geometry - An Geometry object or one of its subclasses. May be null.
        Returns:
        A byte array representing the Geometry object in WKB format or null if the object was null.
      • deserialize

        private static org.locationtech.jts.geom.Geometry deserialize​(byte[] bytes)
        Deserializes a geometry in the WKB format.
        Parameters:
        bytes - A byte array representing a Geometry in WKB format or null.
        Returns:
        The deserialized object or null if the byte array was null.
      • hexStringToByteArray

        private static byte[] hexStringToByteArray​(java.lang.String s)