Class CheckerPolygon

java.lang.Object
util.AbstractChecker<Polygon,CheckerPolygon>
specialized_checkers.math.CheckerPolygon
All Implemented Interfaces:
InterfaceChecker<AbstractChecker<Polygon,CheckerPolygon>,Polygon>

public class CheckerPolygon extends AbstractChecker<Polygon,CheckerPolygon>
Checker for Polygon instances, providing fluent validation methods for 2D polygon objects.

This class allows you to validate and assert properties of Polygon objects in a fluent and readable way.

  • Constructor Details

    • CheckerPolygon

      protected CheckerPolygon(Polygon polygon, String name)
      Constructs a new CheckerPolygon with the specified polygon and name.
      Parameters:
      polygon - the Polygon to be used by this checker
      name - the name identifying this checker
  • Method Details

    • check

      public static CheckerPolygon check(Polygon polygon, String name)
      Creates a new CheckerPolygon for the given Polygon instance with a custom name.
      Parameters:
      polygon - the Polygon instance to be checked
      name - the name to identify this checker instance (useful for error messages)
      Returns:
      a new CheckerPolygon for the provided Polygon
    • check

      public static CheckerPolygon check(int[] xpoints, int[] ypoints, int npoints, String name)
      Creates a new CheckerPolygon for the given Polygon from the specified parameters with a custom name.
      Parameters:
      xpoints - an array of X coordinates
      ypoints - an array of Y coordinates
      npoints - the total number of points in the Polygon
      name - the name to identify this checker instance (useful for error messages)
      Returns:
      a new CheckerPolygon for the provided Polygon
    • check

      public static CheckerPolygon check(Polygon polygon)
      Creates a new CheckerPolygon for the given Polygon instance with a default name.
      Parameters:
      polygon - the Polygon instance to be checked
      Returns:
      a new CheckerPolygon for the provided Polygon
    • check

      public static CheckerPolygon check(int[] xpoints, int[] ypoints, int npoints)
      Creates a new CheckerPolygon for the given Polygon from the specified parameters.
      Parameters:
      xpoints - an array of X coordinates
      ypoints - an array of Y coordinates
      npoints - the total number of points in the Polygon
      Returns:
      a new CheckerPolygon for the provided Polygon
    • self

      protected CheckerPolygon self()
      Returns this checker instance (for fluent API usage).
      Specified by:
      self in class AbstractChecker<Polygon,CheckerPolygon>
      Returns:
      this CheckerPolygon instance