Package org.jdbi.v3.postgis
Class PostgisCodec
- java.lang.Object
-
- org.jdbi.v3.postgis.PostgisCodec
-
-
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.Geometrydeserialize(byte[] bytes)Deserializes a geometry in the WKB format.java.util.function.Function<org.locationtech.jts.geom.Geometry,Argument>getArgumentFunction()Returns aFunctionthat creates anArgumentto map an attribute value onto the database column.ColumnMapper<org.locationtech.jts.geom.Geometry>getColumnMapper()Returns aColumnMapperthat 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
-
Methods inherited from interface org.jdbi.v3.core.codec.Codec
getArgumentFunction, getColumnMapper
-
-
-
-
Method Detail
-
getColumnMapper
public ColumnMapper<org.locationtech.jts.geom.Geometry> getColumnMapper()
Description copied from interface:CodecReturns aColumnMapperthat creates an attribute value from a database column.Either this method or
Codec.getColumnMapper(ConfigRegistry)must be implemented.- Specified by:
getColumnMapperin interfaceCodec<org.locationtech.jts.geom.Geometry>
-
getArgumentFunction
public java.util.function.Function<org.locationtech.jts.geom.Geometry,Argument> getArgumentFunction()
Description copied from interface:CodecReturns aFunctionthat creates anArgumentto map an attribute value onto the database column.Either this method or
Codec.getArgumentFunction(ConfigRegistry)must be implemented.- Specified by:
getArgumentFunctionin interfaceCodec<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- AnGeometryobject 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 aGeometryin 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)
-
-