Enum Class I18n

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

public enum I18n extends Enum<I18n>
Initializes resource bundle and get messages from keys.

This class will be instantiated only once and will use the JVM's default locale.

Since:
1.0
Author:
Nilhcem
  • Enum Constant Details

    • INSTANCE

      public static final I18n INSTANCE
  • Field Details

  • Method Details

    • values

      public static I18n[] 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 I18n 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
    • get

      public String get(String key)
      Returns the resource for the key passed in parameters.

      If the key is not found, returns an empty string.

      Parameters:
      key - a String representing the key we want to get the resource from.
      Returns:
      The text corresponding to the key passed in parameters, or an empty string if not found.