@ThreadSafe public abstract class GeometryCodec<T extends Geometry> extends Object implements TypeCodec<T>
Constructor and Description |
---|
GeometryCodec() |
Modifier and Type | Method and Description |
---|---|
T |
decode(ByteBuffer bb,
ProtocolVersion protocolVersion) |
ByteBuffer |
encode(T geometry,
ProtocolVersion protocolVersion) |
String |
format(T geometry) |
protected abstract T |
fromWellKnownBinary(ByteBuffer bb)
Creates an instance of a geospatial type from its Well-known Binary
(WKB) representation.
|
protected abstract T |
fromWellKnownText(String source)
Creates an instance of this codec's geospatial type from its Well-known Text (WKT) representation.
|
T |
parse(String s) |
protected abstract ByteBuffer |
toWellKnownBinary(T geometry)
Returns a Well-known
Binary (WKB) representation of the given geospatial object.
|
protected abstract String |
toWellKnownText(T geometry)
Returns a Well-known Text (WKT)
representation of the given geospatial object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accepts, accepts, accepts, accepts, getCqlType, getJavaType
@Nullable public T decode(@Nullable ByteBuffer bb, @NonNull ProtocolVersion protocolVersion)
@Nullable public ByteBuffer encode(@Nullable T geometry, @NonNull ProtocolVersion protocolVersion)
@NonNull public String format(@Nullable T geometry) throws IllegalArgumentException
format
in interface TypeCodec<T extends Geometry>
IllegalArgumentException
@NonNull protected abstract T fromWellKnownText(@NonNull String source)
source
- the Well-known Text representation to parse. Cannot be null.IllegalArgumentException
- if the string does not contain a valid Well-known Text
representation.@NonNull protected abstract T fromWellKnownBinary(@NonNull ByteBuffer bb)
bb
- the Well-known Binary representation to parse. Cannot be null.IllegalArgumentException
- if the given ByteBuffer
does not contain a valid
Well-known Binary representation.@NonNull protected abstract String toWellKnownText(@NonNull T geometry)
geometry
- the geospatial object to convert. Cannot be null.@NonNull protected abstract ByteBuffer toWellKnownBinary(@NonNull T geometry)
geometry
- the geospatial object to convert. Cannot be null.Copyright © 2017–2019. All rights reserved.