Class Common


  • public class Common
    extends Object
    This class define common methods for CLI.
    Since:
    3.0
    Author:
    Laurent Jourdren
    • Method Detail

      • exit

        public static void exit​(int exitCode)
        Exit the application.
        Parameters:
        exitCode - exit code
      • errorExit

        public static void errorExit​(Throwable e,
                                     String message)
        Print error message to the user and exits the application.
        Parameters:
        e - Exception
        message - message to show to the use
      • errorExit

        public static void errorExit​(Throwable e,
                                     String message,
                                     boolean logMessage)
        Print error message to the user and exits the application.
        Parameters:
        e - Exception
        message - message to show to the use
        logMessage - true if message must be logged
      • errorExit

        public static void errorExit​(Throwable e,
                                     String message,
                                     int exitCode)
        Print error message to the user and exits the application.
        Parameters:
        e - Exception
        message - message to show to the use
      • errorExit

        public static void errorExit​(Throwable e,
                                     String message,
                                     boolean logMessage,
                                     int exitCode)
        Print error message to the user and exits the application.
        Parameters:
        e - Exception
        message - message to show to the use
        logMessage - true if message must be logged
      • showMessageAndExit

        public static void showMessageAndExit​(String message)
        Show a message and then exit.
        Parameters:
        message - the message to show
      • showErrorMessageAndExit

        public static void showErrorMessageAndExit​(String message)
        Show a message and then exit.
        Parameters:
        message - the message to show