Class CheckerPolygon
java.lang.Object
com.luchersol.core.util.AbstractChecker<Polygon,CheckerPolygon>
com.luchersol.core.specialized_checkers.math.CheckerPolygon
- All Implemented Interfaces:
InterfaceChecker<AbstractChecker<Polygon,CheckerPolygon>, Polygon>
A specialized checker for
Polygon instances, providing fluent API methods
to assert properties of 2D polygonal shapes.
Typical usage:
int[] xpoints = {0, 50, 100};
int[] ypoints = {0, 100, 0};
CheckerPolygon checker = CheckerPolygon.check(xpoints, ypoints, 3)
// future validations can be chained here
.self();
This class supports multiple factory methods to create a checker directly
from a Polygon instance or from arrays of coordinates, making it flexible
for geometric validations in a fluent and readable style.
- See Also:
-
Field Summary
Fields inherited from class com.luchersol.core.util.AbstractChecker
backObject, exceptionTracker, name, object, saveErrors, stop -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCheckerPolygon(Polygon polygon, String name) Constructs a newCheckerPolygonwith the specified polygon and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerPolygoncheck(int[] xpoints, int[] ypoints, int npoints) Creates a newCheckerPolygonfor the givenPolygonfrom the specified parameters.static CheckerPolygonCreates a newCheckerPolygonfor the givenPolygonfrom the specified parameters with a custom name.static CheckerPolygonCreates a newCheckerPolygonfor the givenPolygoninstance with a default name.static CheckerPolygonCreates a newCheckerPolygonfor the givenPolygoninstance with a custom name.protected CheckerPolygonself()Returns this checker instance (for fluent API usage).Methods inherited from class com.luchersol.core.util.AbstractChecker
checkProperty, checkProperty, checkProperty, checkProperty, end, getMethod, getObject, getProperty, hasErrors, hasNotErrors, is, is, is, isEqual, isNonNull, isNot, isNot, isNull, notSaveErrors, saveErrors, setBackObject, setExceptionTracker, setName, setObject, setSaveErrors, setStop, show, showPassedChecks, showThrownException, stop, toChecker, updateChecker
-
Constructor Details
-
CheckerPolygon
-
-
Method Details
-
check
Creates a newCheckerPolygonfor the givenPolygoninstance with a custom name.- Parameters:
polygon- thePolygoninstance to be checkedname- the name to identify this checker instance (useful for error messages)- Returns:
- a new
CheckerPolygonfor the providedPolygon
-
check
Creates a newCheckerPolygonfor the givenPolygonfrom 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 thePolygonname- the name to identify this checker instance (useful for error messages)- Returns:
- a new
CheckerPolygonfor the providedPolygon
-
check
Creates a newCheckerPolygonfor the givenPolygoninstance with a default name.- Parameters:
polygon- thePolygoninstance to be checked- Returns:
- a new
CheckerPolygonfor the providedPolygon
-
check
Creates a newCheckerPolygonfor the givenPolygonfrom 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
CheckerPolygonfor the providedPolygon
-
self
Returns this checker instance (for fluent API usage).- Specified by:
selfin classAbstractChecker<Polygon,CheckerPolygon> - Returns:
- this
CheckerPolygoninstance
-