Class CheckerPolygon
- All Implemented Interfaces:
InterfaceChecker<AbstractChecker<Polygon,
CheckerPolygon>, Polygon>
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.
-
Field Summary
Fields inherited from class util.AbstractChecker
backObject, exceptionTracker, name, object, saveErrors, stop
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CheckerPolygon
(Polygon polygon, String name) Constructs a newCheckerPolygon
with the specified polygon and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerPolygon
check
(int[] xpoints, int[] ypoints, int npoints) Creates a newCheckerPolygon
for the givenPolygon
from the specified parameters.static CheckerPolygon
Creates a newCheckerPolygon
for the givenPolygon
from the specified parameters with a custom name.static CheckerPolygon
Creates a newCheckerPolygon
for the givenPolygon
instance with a default name.static CheckerPolygon
Creates a newCheckerPolygon
for the givenPolygon
instance with a custom name.protected CheckerPolygon
self()
Returns this checker instance (for fluent API usage).Methods inherited from class util.AbstractChecker
checkProperty, checkProperty, checkProperty, end, getMethod, getObject, getProperty, hasErrors, hasNotErrors, is, is, isEqual, isNonNull, isNot, isNot, isNull, notSaveErrors, saveErrors, show, showNotThrownException, showThrownException, stop
-
Constructor Details
-
CheckerPolygon
-
-
Method Details
-
check
Creates a newCheckerPolygon
for the givenPolygon
instance with a custom name.- Parameters:
polygon
- thePolygon
instance to be checkedname
- the name to identify this checker instance (useful for error messages)- Returns:
- a new
CheckerPolygon
for the providedPolygon
-
check
Creates a newCheckerPolygon
for the givenPolygon
from the specified parameters with a custom name.- Parameters:
xpoints
- an array of X coordinatesypoints
- an array of Y coordinatesnpoints
- the total number of points in thePolygon
name
- the name to identify this checker instance (useful for error messages)- Returns:
- a new
CheckerPolygon
for the providedPolygon
-
check
Creates a newCheckerPolygon
for the givenPolygon
instance with a default name.- Parameters:
polygon
- thePolygon
instance to be checked- Returns:
- a new
CheckerPolygon
for the providedPolygon
-
check
Creates a newCheckerPolygon
for the givenPolygon
from the specified parameters.- Parameters:
xpoints
- an array of X coordinatesypoints
- an array of Y coordinatesnpoints
- the total number of points in thePolygon
- Returns:
- a new
CheckerPolygon
for the providedPolygon
-
self
Returns this checker instance (for fluent API usage).- Specified by:
self
in classAbstractChecker<Polygon,
CheckerPolygon> - Returns:
- this
CheckerPolygon
instance
-