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 be null
targetByteOrder - 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 Details

  • Constructor Details

    • EndianConverterVisitor

      private EndianConverterVisitor(ByteBuffer output, ByteOrder targetByteOrder)
      Creates an instance of a EndianConverterVisitor record class.
      Parameters:
      output - the value for the output record component
      targetByteOrder - the value for the targetByteOrder record component
  • Method Details

    • enterGeometry

      public boolean enterGeometry(int wkbType, boolean hasZ, boolean hasM, int stride)
      Description copied from interface: GeometryVisitor
      Called when a geometry sequence has started.
      Specified by:
      enterGeometry in interface GeometryVisitor
      Parameters:
      wkbType - the WKB geometry type
      hasZ - whether the geometry has a Z-axis
      hasM - whether the geometry has an M-axis
      stride - the stride for given coordinates, 2D vs 3D
      Returns:
      true if the visitor should continue visiting, false otherwise
    • enterCollectionGeometry

      public boolean enterCollectionGeometry(byte byteOrder)
      Description copied from interface: GeometryVisitor
      Called when a GEOMETRYCOLLECTION geometry type is observed.
      Specified by:
      enterCollectionGeometry in interface GeometryVisitor
      Parameters:
      byteOrder - the byte order
      Returns:
      true if the visitor should continue visiting, false otherwise
    • enterSubGeometry

      public boolean enterSubGeometry(byte byteOrder, int wkbType)
      Description copied from interface: GeometryVisitor
      Called just before visiting sub-geometry types inside a MULTIPOINT, MULTILINESTRING, or a MULTIPOLYGON geometry type.
      Specified by:
      enterSubGeometry in interface GeometryVisitor
      Parameters:
      byteOrder - the byte order
      wkbType - the sub geometry type
      Returns:
      true if the visitor should continue visiting, false otherwise
    • visitSrid

      public void visitSrid(int srid)
      Description copied from interface: GeometryVisitor
      Called 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:
      visitSrid in interface GeometryVisitor
      Parameters:
      srid - the spatial reference identifier
    • visitCoordinate

      public void visitCoordinate(double[] ordinates)
      Description copied from interface: GeometryVisitor
      Called 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:
      visitCoordinate in interface GeometryVisitor
      Parameters:
      ordinates - the coordinate values
    • startLineString

      public void startLineString(int pointCount)
      Description copied from interface: GeometryVisitor
      Called after reading the number of points inside a LINESTRING geometry type.
      Specified by:
      startLineString in interface GeometryVisitor
      Parameters:
      pointCount - the number of points
    • startPolygon

      public void startPolygon(int ringCount)
      Description copied from interface: GeometryVisitor
      Called after reading the number of rings inside a POLYGON geometry type.
      Specified by:
      startPolygon in interface GeometryVisitor
      Parameters:
      ringCount - the number of rings
    • startRing

      public void startRing(int ringIndex, int pointCount)
      Description copied from interface: GeometryVisitor
      Called after reading the number of points present in a ring within a polygon.
      Specified by:
      startRing in interface GeometryVisitor
      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: GeometryVisitor
      Called after reading the number of points present in a MULTIPOINT geometry type.
      Specified by:
      startMultiPoint in interface GeometryVisitor
      Parameters:
      pointCount - the number of points
    • startMultiLineString

      public void startMultiLineString(int lineStringCount)
      Description copied from interface: GeometryVisitor
      Called after reading the number of line strings present in a MULTILINESTRING geometry type.
      Specified by:
      startMultiLineString in interface GeometryVisitor
      Parameters:
      lineStringCount - the number of line strings
    • startMultiPolygon

      public void startMultiPolygon(int polygonCount)
      Description copied from interface: GeometryVisitor
      Called after reading the number of polygons present in a MULTIPOYLGON geometry type.
      Specified by:
      startMultiPolygon in interface GeometryVisitor
      Parameters:
      polygonCount - the number of polygons
    • startGeometryCollection

      public void startGeometryCollection(int geometryCount)
      Description copied from interface: GeometryVisitor
      Called after reading the number of geometries present in a GEOMETRYCOLLECTION geometry type.
      Specified by:
      startGeometryCollection in interface GeometryVisitor
      Parameters:
      geometryCount - the number of geometries
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • output

      public ByteBuffer output()
      Returns the value of the output record component.
      Returns:
      the value of the output record component
    • targetByteOrder

      public ByteOrder targetByteOrder()
      Returns the value of the targetByteOrder record component.
      Returns:
      the value of the targetByteOrder record component