Package com.nilhcem.fakesmtp.model
Enum Class UIModel
- All Implemented Interfaces:
Serializable,Comparable<UIModel>,java.lang.constant.Constable
UI presentation model of the application.
The essence of a Presentation Model is of a fully self-contained class that represents all the data and behavior of the UI window, but without any of the controls used to render that UI on the screen.
- Since:
- 1.0
- Author:
- Nilhcem
- See Also:
-
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 TypeMethodDescriptionintbooleanReturnstrueif the server is started.voidvoidsetNbMessageReceived(int nbMessageReceived) voidvoidsetRelayDomains(List<String> relayDomains) voidsetSavePath(String savePath) voidHappens when a user clicks on the start button.static UIModelReturns the enum constant of this class with the specified name.static UIModel[]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
-
toggleButton
public void toggleButton() throws BindPortException, OutOfRangePortException, InvalidPortException, InvalidHostExceptionHappens when a user clicks on the start button.This method will notify the
SMTPServerHandlerto start the server.- Throws:
InvalidPortException- when the port is invalid.BindPortException- when the port cannot be bound.OutOfRangePortException- when the port is out of range.InvalidHostException- when the address cannot be resolved.RuntimeException- when an unknown exception happened.
-
isStarted
public boolean isStarted()Returnstrueif the server is started.- Returns:
trueif the server is started.
-
setPort
-
setHost
-
getNbMessageReceived
public int getNbMessageReceived() -
setNbMessageReceived
public void setNbMessageReceived(int nbMessageReceived) -
getSavePath
-
setSavePath
-
getListMailsMap
-
getRelayDomains
-
setRelayDomains
-