java.lang.Object
ai.tutor.cab302exceptionalhandlers.Utils.Utils

public final class Utils extends Object
General utility class for helper methods
Author:
Mason M.
  • Method Details

    • validateNullOrEmpty

      public static boolean validateNullOrEmpty(String value)
      Validates if a string is null or empty (after trimming whitespace).
      Parameters:
      value - The string to validate.
      Returns:
      True if the string is null or empty, false otherwise.
    • showErrorAlert

      public static void showErrorAlert(String message)
      Displays an error alert dialog with the specified message.
      Parameters:
      message - The error message to display.
    • showInfoAlert

      public static void showInfoAlert(String message)
      Displays an information alert dialog with the specified message.
      Parameters:
      message - The informational message to display.
    • showWarningAlert

      public static void showWarningAlert(String message)
      Displays a warning alert dialog with the specified message.
      Parameters:
      message - The warning message to display.
    • showConfirmAlert

      public static Optional<javafx.scene.control.ButtonType> showConfirmAlert(String message)
      Displays a confirmation alert dialog with the specified message and returns the user's choice.
      Parameters:
      message - The confirmation message to display.
      Returns:
      An Optional containing the ButtonType clicked by the user (e.g., OK, Cancel).