Class Contact

java.lang.Object
io.micronaut.email.Contact

@Introspected public class Contact extends Object
Class representing the person who receives an email.
Since:
1.0.0
Author:
Sergio del Amo
  • Constructor Details

    • Contact

      public Contact(@NonNull @NonNull String email)
      Parameters:
      email - Contact's email.
    • Contact

      public Contact(@NonNull @NonNull String email, @Nullable @Nullable String name)
      Parameters:
      email - Recipient's email.
      name - Recipient's name.
  • Method Details

    • getEmail

      public String getEmail()
      Returns:
      Recipient's email.
    • getName

      @Nullable public @Nullable String getName()
      Returns:
      Recipient's name
    • getNameAddress

      @NonNull public @NonNull String getNameAddress()
      returns name-addr for a Contact. Given: Contact(email: 'johnsnow@example.com, name: John Snow) When: Contact::getNameAddress() Then: John Snow <johnsnow@example.com> Given: Contact(email: 'johnsnow@example.com, name: null) When: Contact::getNameAddress() Then: <johnsnow@example.com>
      Returns:
      An optional name that indicates the name of the recipient that could be displayed to the user of a mail application, and the email address enclosed in angle brackets
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object