Package io.debezium.spatial
Record Class GeometryEndiannessConverter.EndianConverterVisitor
java.lang.Object
java.lang.Record
io.debezium.spatial.GeometryEndiannessConverter.EndianConverterVisitor
- Record Components:
output- the output byte buffer to write into, must not benulltargetByteOrder- the target byte order that the output uses
- All Implemented Interfaces:
GeometryVisitor
- Enclosing class:
GeometryEndiannessConverter
private static record GeometryEndiannessConverter.EndianConverterVisitor(ByteBuffer output, ByteOrder targetByteOrder)
extends Record
implements GeometryVisitor
Visitor implementation that writes to the output buffer the contents of an existing geometry
representation, but using the given target byte order.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufferThe field for theoutputrecord component.private final ByteOrderThe field for thetargetByteOrderrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEndianConverterVisitor(ByteBuffer output, ByteOrder targetByteOrder) Creates an instance of aEndianConverterVisitorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanenterCollectionGeometry(byte byteOrder) Called when aGEOMETRYCOLLECTIONgeometry type is observed.booleanenterGeometry(int wkbType, boolean hasZ, boolean hasM, int stride) Called when a geometry sequence has started.booleanenterSubGeometry(byte byteOrder, int wkbType) Called just before visiting sub-geometry types inside aMULTIPOINT,MULTILINESTRING, or aMULTIPOLYGONgeometry type.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.output()Returns the value of theoutputrecord component.voidstartGeometryCollection(int geometryCount) Called after reading the number of geometries present in aGEOMETRYCOLLECTIONgeometry type.voidstartLineString(int pointCount) Called after reading the number of points inside aLINESTRINGgeometry type.voidstartMultiLineString(int lineStringCount) Called after reading the number of line strings present in aMULTILINESTRINGgeometry type.voidstartMultiPoint(int pointCount) Called after reading the number of points present in aMULTIPOINTgeometry type.voidstartMultiPolygon(int polygonCount) Called after reading the number of polygons present in aMULTIPOYLGONgeometry type.voidstartPolygon(int ringCount) Called after reading the number of rings inside aPOLYGONgeometry type.voidstartRing(int ringIndex, int pointCount) Called after reading the number of points present in a ring within a polygon.Returns the value of thetargetByteOrderrecord component.final StringtoString()Returns a string representation of this record class.voidvisitCoordinate(double[] ordinates) Called after reading the coordinates of a point.voidvisitSrid(int srid) Called after the geometry spatial reference identifier was read.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.debezium.spatial.GeometryVisitor
endGeometryCollection, endLineString, endMultiLineString, endMultiPoint, endMultiPolygon, endPolygon, endRing, exitCollectionGeometry, exitGeometry, exitSubGeometry
-
Field Details
-
output
The field for theoutputrecord component. -
targetByteOrder
The field for thetargetByteOrderrecord component.
-
-
Constructor Details
-
EndianConverterVisitor
Creates an instance of aEndianConverterVisitorrecord class.- Parameters:
output- the value for theoutputrecord componenttargetByteOrder- the value for thetargetByteOrderrecord component
-
-
Method Details
-
enterGeometry
public boolean enterGeometry(int wkbType, boolean hasZ, boolean hasM, int stride) Description copied from interface:GeometryVisitorCalled when a geometry sequence has started.- Specified by:
enterGeometryin interfaceGeometryVisitor- Parameters:
wkbType- the WKB geometry typehasZ- whether the geometry has a Z-axishasM- whether the geometry has an M-axisstride- the stride for given coordinates, 2D vs 3D- Returns:
trueif the visitor should continue visiting,falseotherwise
-
enterCollectionGeometry
public boolean enterCollectionGeometry(byte byteOrder) Description copied from interface:GeometryVisitorCalled when aGEOMETRYCOLLECTIONgeometry type is observed.- Specified by:
enterCollectionGeometryin interfaceGeometryVisitor- Parameters:
byteOrder- the byte order- Returns:
trueif the visitor should continue visiting,falseotherwise
-
enterSubGeometry
public boolean enterSubGeometry(byte byteOrder, int wkbType) Description copied from interface:GeometryVisitorCalled just before visiting sub-geometry types inside aMULTIPOINT,MULTILINESTRING, or aMULTIPOLYGONgeometry type.- Specified by:
enterSubGeometryin interfaceGeometryVisitor- Parameters:
byteOrder- the byte orderwkbType- the sub geometry type- Returns:
trueif the visitor should continue visiting,falseotherwise
-
visitSrid
public void visitSrid(int srid) Description copied from interface:GeometryVisitorCalled after the geometry spatial reference identifier was read. If the Geometry is not an Extended Well-Known Binary (EWKB) type that has the spatial reference identifier, this won't be called.- Specified by:
visitSridin interfaceGeometryVisitor- Parameters:
srid- the spatial reference identifier
-
visitCoordinate
public void visitCoordinate(double[] ordinates) Description copied from interface:GeometryVisitorCalled after reading the coordinates of a point. The stride of the point can be determined by the number of values in the array.- Specified by:
visitCoordinatein interfaceGeometryVisitor- Parameters:
ordinates- the coordinate values
-
startLineString
public void startLineString(int pointCount) Description copied from interface:GeometryVisitorCalled after reading the number of points inside aLINESTRINGgeometry type.- Specified by:
startLineStringin interfaceGeometryVisitor- Parameters:
pointCount- the number of points
-
startPolygon
public void startPolygon(int ringCount) Description copied from interface:GeometryVisitorCalled after reading the number of rings inside aPOLYGONgeometry type.- Specified by:
startPolygonin interfaceGeometryVisitor- Parameters:
ringCount- the number of rings
-
startRing
public void startRing(int ringIndex, int pointCount) Description copied from interface:GeometryVisitorCalled after reading the number of points present in a ring within a polygon.- Specified by:
startRingin interfaceGeometryVisitor- Parameters:
ringIndex- the ring index, 0-based.pointCount- the number of points present within the ring
-
startMultiPoint
public void startMultiPoint(int pointCount) Description copied from interface:GeometryVisitorCalled after reading the number of points present in aMULTIPOINTgeometry type.- Specified by:
startMultiPointin interfaceGeometryVisitor- Parameters:
pointCount- the number of points
-
startMultiLineString
public void startMultiLineString(int lineStringCount) Description copied from interface:GeometryVisitorCalled after reading the number of line strings present in aMULTILINESTRINGgeometry type.- Specified by:
startMultiLineStringin interfaceGeometryVisitor- Parameters:
lineStringCount- the number of line strings
-
startMultiPolygon
public void startMultiPolygon(int polygonCount) Description copied from interface:GeometryVisitorCalled after reading the number of polygons present in aMULTIPOYLGONgeometry type.- Specified by:
startMultiPolygonin interfaceGeometryVisitor- Parameters:
polygonCount- the number of polygons
-
startGeometryCollection
public void startGeometryCollection(int geometryCount) Description copied from interface:GeometryVisitorCalled after reading the number of geometries present in aGEOMETRYCOLLECTIONgeometry type.- Specified by:
startGeometryCollectionin interfaceGeometryVisitor- Parameters:
geometryCount- the number of geometries
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
output
Returns the value of theoutputrecord component.- Returns:
- the value of the
outputrecord component
-
targetByteOrder
Returns the value of thetargetByteOrderrecord component.- Returns:
- the value of the
targetByteOrderrecord component
-