public class

NewsAddress

extends Address
java.lang.Object
   ↳ com.google.code.javax.mail.Address
     ↳ com.google.code.javax.mail.internet.NewsAddress

Class Overview

This class models an RFC1036 newsgroup address.

Summary

Constants
long serialVersionUID
[Expand]
Inherited Constants
From class com.google.code.javax.mail.Address
Fields
protected String host
protected String newsgroup
Public Constructors
NewsAddress()
Default 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.
Public Methods
boolean equals(Object a)
The equality operator.
String getHost()
Get the host.
String getNewsgroup()
Get the newsgroup.
String getType()
Return the type of this address.
int hashCode()
Compute a hash code for the address.
static NewsAddress[] parse(String newsgroups)
Parse the given comma separated sequence of newsgroup into NewsAddress objects.
void setHost(String host)
Set the host.
void setNewsgroup(String newsgroup)
Set the newsgroup.
static String toString(Address[] addresses)
Convert the given array of NewsAddress objects into a comma separated sequence of address strings.
String toString()
Convert this address into a RFC 1036 address.
[Expand]
Inherited Methods
From class com.google.code.javax.mail.Address
From class java.lang.Object

Constants

private static final long serialVersionUID

Constant Value: -4203797299824684143 (0xc5a91ca0e4341391)

Fields

protected String host

protected String newsgroup

Public Constructors

public NewsAddress ()

Default constructor.

public NewsAddress (String newsgroup)

Construct a NewsAddress with the given newsgroup.

Parameters
newsgroup The newsgroup

public NewsAddress (String newsgroup, String host)

Construct a NewsAddress with the given newsgroup and host.

Parameters
newsgroup The newsgroup
host The host

Public Methods

public boolean equals (Object a)

The equality operator.

Parameters
a Address object

public String getHost ()

Get the host.

Returns
  • host

public String getNewsgroup ()

Get the newsgroup.

Returns
  • newsgroup

public String getType ()

Return the type of this address. The type of a NewsAddress is "news".

Returns
  • address type

public int hashCode ()

Compute a hash code for the address.

public static NewsAddress[] parse (String newsgroups)

Parse the given comma separated sequence of newsgroup into NewsAddress objects.

Parameters
newsgroups Comma separated newsgroup string
Returns
  • array of NewsAddress objects
Throws
AddressException if the parse failed

public void setHost (String host)

Set the host.

Parameters
host The host

public void setNewsgroup (String newsgroup)

Set the newsgroup.

Parameters
newsgroup The newsgroup

public static String toString (Address[] addresses)

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

public String toString ()

Convert this address into a RFC 1036 address.

Returns
  • newsgroup