Centralized argument validation utility for detecting and reporting null or blank values.
More...
|
| boolean | checkNPE (Object obj, String methodName, String name) |
| | Performs a non-blocking null or blank check and triggers a diagnostic dialog upon failure.
|
|
| boolean | checkNullOrBlankInternal (Object obj, String methodName, String name) |
| | Validates the given object for null or blank values.
|
Centralized argument validation utility for detecting and reporting null or blank values.
Implemented as an enum singleton to ensure a single shared instance. Designed for defensive programming and consistent user feedback through standardized error dialogs.
◆ checkNPE()
| boolean fr.softsf.canscan.util.Checker.checkNPE |
( |
Object | obj, |
|
|
String | methodName, |
|
|
String | name ) |
Performs a non-blocking null or blank check and triggers a diagnostic dialog upon failure.
Note: This method does not throw exceptions. Callers must handle the boolean return value to ensure thread safety and prevent downstream NullPointerException. *
Execution Patterns:
-
Standard guard clause:
if (Checker.INSTANCE.checkNPE(arg, "method", "arg"))
return;
-
Constructor validation:
Checker.INSTANCE.checkNPE(arg, ...); this.field =
Objects.requireNonNull(arg);
- Parameters
-
| obj | the object to validate; performs blank check if instance of String |
| methodName | diagnostic context identifying the caller |
| name | display name of the validated parameter |
- Returns
true if the object is null or blank; false otherwise
◆ checkNullOrBlankInternal()
| boolean fr.softsf.canscan.util.Checker.checkNullOrBlankInternal |
( |
Object | obj, |
|
|
String | methodName, |
|
|
String | name ) |
|
private |
Validates the given object for null or blank values.
Displays a standardized error dialog if invalid.
- Parameters
-
| obj | the object to validate |
| methodName | the name of the calling method |
| name | the name of the parameter |
- Returns
true if the object is invalid; false otherwise
◆ INSTANCE
| fr.softsf.canscan.util.Checker.INSTANCE |
The documentation for this enum was generated from the following file: