Record Class MailProperties

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.infrastructure.mail.MailProperties
Record Components:
from - sender address of every message.
baseUrl - public base URL of the authorization server, used to build the links of the messages (without a trailing slash).
locale - language of the messages; it is explicit configuration, never the platform's default.

@ConfigurationProperties(prefix="authserver.mail") public record MailProperties(String from, String baseUrl, Locale locale) extends Record
Settings of the e-mails sent by SmtpAccountMailer. The SMTP connection itself is configured with the standard spring.mail.* properties and holds no credentials in this repository.
  • Field Details

    • from

      private final String from
      The field for the from record component.
    • baseUrl

      private final String baseUrl
      The field for the baseUrl record component.
    • locale

      private final Locale locale
      The field for the locale record component.
    • DEFAULT_FROM

      public static final String DEFAULT_FROM
      Sender used when none is configured.
      See Also:
    • DEFAULT_BASE_URL

      public static final String DEFAULT_BASE_URL
      Base URL used when none is configured.
      See Also:
  • Constructor Details

    • MailProperties

      public MailProperties(String from, String baseUrl, Locale locale)
      Applies the defaults of the missing values and removes a trailing slash of the base URL.
      Parameters:
      from - sender address, or null for DEFAULT_FROM.
      baseUrl - public base URL, or null for DEFAULT_BASE_URL.
      locale - language of the messages, or null for English.
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • from

      public String from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • baseUrl

      public String baseUrl()
      Returns the value of the baseUrl record component.
      Returns:
      the value of the baseUrl record component
    • locale

      public Locale locale()
      Returns the value of the locale record component.
      Returns:
      the value of the locale record component