java.lang.Object
jakarta.mail.Address
jakarta.mail.internet.NewsAddress
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.NewsAddress(String newsgroup) Construct a NewsAddress with the given newsgroup.NewsAddress(String newsgroup, String host) Construct a NewsAddress with the given newsgroup and host. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe equality operator.getHost()Get the host.Get the newsgroup.getType()Return the type of this address.inthashCode()Compute a hash code for the address.static NewsAddress[]Parse the given comma separated sequence of newsgroups into NewsAddress objects.voidSet the host.voidsetNewsgroup(String newsgroup) Set the newsgroup.toString()Convert this address into a RFC 1036 address.static StringConvert the given array of NewsAddress objects into a comma separated sequence of address strings.
-
Field Details
-
newsgroup
The newsgroup. -
host
The host. May benull.
-
-
Constructor Details
-
NewsAddress
public NewsAddress()Default constructor. -
NewsAddress
Construct a NewsAddress with the given newsgroup.- Parameters:
newsgroup- the newsgroup
-
NewsAddress
-
-
Method Details
-
getType
-
setNewsgroup
-
getNewsgroup
-
setHost
-
getHost
-
toString
-
equals
-
hashCode
-
toString
Convert the given array of NewsAddress objects into a comma separated sequence of address strings. The resulting string contains only US-ASCII characters, and hence is mail-safe.- Parameters:
addresses- array of NewsAddress objects- Returns:
- comma separated address strings
- Throws:
ClassCastException- if any address object in the given array is not a NewsAddress objects. Note that this is a RuntimeException.
-
parse
Parse the given comma separated sequence of newsgroups into NewsAddress objects.- Parameters:
newsgroups- comma separated newsgroup string- Returns:
- array of NewsAddress objects
- Throws:
AddressException- if the parse failed
-