Package com.nilhcem.fakesmtp.core
Enum Class ArgsHandler
- All Implemented Interfaces:
Serializable
,Comparable<ArgsHandler>
,java.lang.constant.Constable
Handles command line arguments.
- Since:
- 1.3
- Author:
- Nilhcem
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoid
Displays the app's usage in the standard output.getPort()
void
handleArgs
(String[] args) Interprets command line arguments.boolean
boolean
boolean
static ArgsHandler
Returns the enum constant of this class with the specified name.static ArgsHandler[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
handleArgs
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
- Returns:
- the port, as specified by the user, or a
null
string if unspecified.
-
getBindAddress
- Returns:
- the bind address, as specified by the user, or a
null
string if unspecified.
-
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
- Returns:
- the name of executable used for viewing eml files, as specified by the user, or a
null
string if unspecified.
-