Module jakarta.mail
Package jakarta.mail

Class Address

  • All Implemented Interfaces:
    Direct Known Subclasses:
    InternetAddress, NewsAddress

    public abstract class Address
    extends java.lang.Object
    This abstract class models the addresses in a message. Subclasses provide specific implementations. Subclasses will typically be serializable so that (for example) the use of Address objects in search terms can be serialized along with the search terms.
    John Mani, Bill Shannon
    See Also:
    Serialized Form
    • Constructor Summary

      Constructor Description
      Creates a default Address.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract boolean equals​(java.lang.Object address)
      The equality operator.
      abstract java.lang.String getType()
      Return a type string that identifies this address type.
      abstract java.lang.String toString()
      Return a String representation of this address object.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Address

        public Address()
        Creates a default Address.
    • Method Detail

      • getType

        public abstract java.lang.String getType()
        Return a type string that identifies this address type.
        address type
        See Also:
      • toString

        public abstract java.lang.String toString()
        Return a String representation of this address object.
        toString in class java.lang.Object
        string representation of this address
      • equals

        public abstract boolean equals​(java.lang.Object address)
        The equality operator. Subclasses should provide an implementation of this method that supports value equality (do the two Address objects represent the same destination?), not object reference equality. A subclass must also provide a corresponding implementation of the hashCode method that preserves the general contract of equals and hashCode - objects that compare as equal must have the same hashCode.
        equals in class java.lang.Object
        address - Address object