Interface EmailAddress


public interface EmailAddress
Provides a structured representation of a single email address, parsed from a header such as To, From, or Cc.

For a given email address string such as "Vern User <vern_user+vaultId=123@veeva.com>", this interface provides access to each component part.

  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the display name of the sender or recipient, if one was provided.
    Retrieves the domain of the email address.
    Retrieves the full, un-parsed email address string as it appeared in the email header.
    Retrieves the sub-address of the email address.
    Retrieves the local-part of the email address, excluding any sub-address.
  • Method Details

    • getUserName

      String getUserName()
      Retrieves the local-part of the email address, excluding any sub-address. This is the portion of the email address before the @ sign, and before any sub-address.

      For example, given the address "vern_user+vaultId=123@veeva.com", this method returns "vern_user".

      Returns:
      The local-part of the email address, excluding any sub-address.
    • getSubAddress

      String getSubAddress()
      Retrieves the sub-address of the email address. This is the portion of the local-part that follows a delimiter, such as a plus sign (+).

      For example, given the address "vern_user+vaultId=123@veeva.com", this method returns "vaultId=123".

      Returns:
      The sub-address, or null if there is no sub-address.
    • getDomain

      String getDomain()
      Retrieves the domain of the email address. This is the portion of the email address after the @ sign.

      For example, given the address "vern_user+vaultId=123@veeva.com", this method returns "veeva.com".

      Returns:
      The domain part of the email address.
    • getFullAddress

      String getFullAddress()
      Retrieves the full, un-parsed email address string as it appeared in the email header. For example, if the address header reads "Vern User <vern_user+vaultId=123@veeva.com>", this method returns "Vern User <vern_user+vaultId=123@veeva.com>".
      Returns:
      The full email address string.
    • getDisplayName

      String getDisplayName()
      Retrieves the display name of the sender or recipient, if one was provided.

      For example, given the address "Vern User <vern_user+vaultId=123@veeva.com>", this method returns "Vern User".

      Returns:
      The display name, or null if there is no display name.