Enum Class ArgsHandler

java.lang.Object
java.lang.Enum<ArgsHandler>
com.nilhcem.fakesmtp.core.ArgsHandler
All Implemented Interfaces:
Serializable, Comparable<ArgsHandler>, java.lang.constant.Constable

public enum ArgsHandler extends Enum<ArgsHandler>
Handles command line arguments.
Since:
1.3
Author:
Nilhcem
  • Enum Constant Details

  • Method Details

    • values

      public static ArgsHandler[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ArgsHandler valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • handleArgs

      public void handleArgs(String[] args) throws org.apache.commons.cli.ParseException
      Interprets command line arguments.
      Parameters:
      args - program's arguments.
      Throws:
      org.apache.commons.cli.ParseException - when arguments are invalid.
    • displayUsage

      public void displayUsage()
      Displays the app's usage in the standard output.
    • shouldStartServerAtLaunch

      public boolean shouldStartServerAtLaunch()
      Returns:
      whether or not the SMTP server must be started automatically at launch.
    • shouldStartInBackground

      public boolean shouldStartInBackground()
      Returns:
      whether or not the SMTP server must be running without a GUI, only if started at launch (if shouldStartServerAtLaunch() returns true}).
      See Also:
    • getPort

      public String getPort()
      Returns:
      the port, as specified by the user, or a null string if unspecified.
    • getBindAddress

      public String getBindAddress()
      Returns:
      the bind address, as specified by the user, or a null string if unspecified.
    • getOutputDirectory

      public String getOutputDirectory()
      Returns:
      the output directory, as specified by the user, or a null string if unspecified.
    • memoryModeEnabled

      public boolean memoryModeEnabled()
      Returns:
      whether or not the SMTP server should disable the persistence in order to avoid the overhead that it adds. This is particularly useful when we launch performance tests that massively send emails.
    • getEmlViewer

      public String getEmlViewer()
      Returns:
      the name of executable used for viewing eml files, as specified by the user, or a null string if unspecified.