CanScan
Loading...
Searching...
No Matches
fr.softsf.canscan.util.Checker Enum Reference

Centralized argument validation utility for detecting and reporting null or blank values. More...

Collaboration diagram for fr.softsf.canscan.util.Checker:

Public Member Functions

boolean checkNPE (Object obj, String methodName, String name)
 Performs a non-blocking null or blank check and triggers a diagnostic dialog upon failure.

Public Attributes

 INSTANCE

Private Member Functions

boolean checkNullOrBlankInternal (Object obj, String methodName, String name)
 Validates the given object for null or blank values.

Detailed Description

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.

Member Function Documentation

◆ 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
objthe object to validate; performs blank check if instance of String
methodNamediagnostic context identifying the caller
namedisplay name of the validated parameter
Returns
true if the object is null or blank; false otherwise
Here is the call graph for this function:

◆ 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
objthe object to validate
methodNamethe name of the calling method
namethe name of the parameter
Returns
true if the object is invalid; false otherwise

Member Data Documentation

◆ INSTANCE

fr.softsf.canscan.util.Checker.INSTANCE

The documentation for this enum was generated from the following file: