Module bus.extra

Enum Class GlobalMailAccount

java.lang.Object
java.lang.Enum<GlobalMailAccount>
org.miaixz.bus.extra.mail.GlobalMailAccount
All Implemented Interfaces:
Serializable, Comparable<GlobalMailAccount>, Constable

public enum GlobalMailAccount extends Enum<GlobalMailAccount>
Represents a global mail account, implemented as a singleton enum. This class is responsible for loading and holding a single, globally accessible MailAccount instance from a configuration file specified in MailAccount.MAIL_SETTING_PATHS.
Since:
Java 17+
Author:
Kimi Liu
  • Enum Constant Details

    • INSTANCE

      public static final GlobalMailAccount INSTANCE
      The singleton instance of the global mail account.
  • Method Details

    • values

      public static GlobalMailAccount[] 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 GlobalMailAccount 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
    • getAccount

      public MailAccount getAccount()
      Retrieves the globally configured mail account.
      Returns:
      The global MailAccount instance.
    • setSplitLongParams

      public void setSplitLongParams(boolean splitLongParams)
      Sets whether to split long parameters in MIME headers. This is a global setting. Note: This method calls System.setProperty(String, String).
      Parameters:
      splitLongParams - true to enable splitting, false to disable it.
    • setCharset

      public void setCharset(Charset charset)
      Sets the global default character set for MIME messages. Note: This method calls System.setProperty(String, String).
      Parameters:
      charset - The character set to set as the global default.