javax.slee
Class Address

java.lang.Object
  |
  +--javax.slee.Address
All Implemented Interfaces:
java.io.Serializable

public class Address
extends java.lang.Object
implements java.io.Serializable

The Address class encapsulates an address that can be used by the SLEE. An address consists of the following two components:

An Address object is immutable. Once it has been created the values contained by it cannot change.

Valid Addresses The valid values for address strings is dependent on the address plan for an address. The following is a list of valid address strings for each address plan:

See Also:
Serialized Form

Constructor Summary
Address(AddressPlan addressPlan, java.lang.String addressString)
          Create a new Address using an address plan and address string.
Address(AddressPlan addressPlan, java.lang.String addressString, AddressPresentation addressPresentation, AddressScreening addressScreening, java.lang.String subAddressString, java.lang.String addressName)
          Create a new Address using an address plan, an address string, an additional optional attributes.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this address object for equality with another.
 java.lang.String getAddressName()
          Get the optional address name for the address.
 AddressPlan getAddressPlan()
          Get the address plan for the address.
 AddressPresentation getAddressPresentation()
          Get the optional address presentation attribute for the address.
 AddressScreening getAddressScreening()
          Get the optional address screening attribute for the address.
 java.lang.String getAddressString()
          Get the address string for the address.
 java.lang.String getSubAddressString()
          Get the optional sub-address string for the address.
 int hashCode()
          Get a hash code value for this address object.
 java.lang.String toString()
          Get the textual representation of the address object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Address

public Address(AddressPlan addressPlan,
               java.lang.String addressString)
Create a new Address using an address plan and address string.
Parameters:
addressPlan - the address plan for this address.
addressString - the address string for this address.
Throws:
java.lang.NullPointerException - if either addressPlan or addressString is null.
java.lang.IllegalArgumentException - if addressString is zero-length.

Address

public Address(AddressPlan addressPlan,
               java.lang.String addressString,
               AddressPresentation addressPresentation,
               AddressScreening addressScreening,
               java.lang.String subAddressString,
               java.lang.String addressName)
Create a new Address using an address plan, an address string, an additional optional attributes.
Parameters:
addressPlan - the address plan for this address.
addressString - the address string for this address.
addressPresentation - an optional argument describing whether the address can be presented to other call parties.
addressScreening - an optional argument describing whether the address has been screened by a user application.
subAddressString - an optional argument that provides a sub-address string for protocols that allow sub-addressing.
addressName - an optional argument that allows a more personal name to be associated with the address.
Throws:
java.lang.NullPointerException - if either addressPlan or addressString is null.
java.lang.IllegalArgumentException - if addressString is zero-length.
Method Detail

getAddressPlan

public AddressPlan getAddressPlan()
Get the address plan for the address.
Returns:
the address plan.

getAddressString

public java.lang.String getAddressString()
Get the address string for the address.
Returns:
the address string.

getAddressPresentation

public AddressPresentation getAddressPresentation()
Get the optional address presentation attribute for the address.
Returns:
the address presentation attribute, or null if no address presentation attribute was specified.

getAddressScreening

public AddressScreening getAddressScreening()
Get the optional address screening attribute for the address.
Returns:
the address screening attribute, or null if no address screening attribute was specified.

getSubAddressString

public java.lang.String getSubAddressString()
Get the optional sub-address string for the address.
Returns:
the sub-address string, or null if no sub-address string was specified.

getAddressName

public java.lang.String getAddressName()
Get the optional address name for the address.
Returns:
the address name, or null if no address name was specified.

equals

public boolean equals(java.lang.Object obj)
Compare this address object for equality with another.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is an instance of this class containing the same address plan and address string as this, false otherwise.

hashCode

public int hashCode()
Get a hash code value for this address object.
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value.

toString

public java.lang.String toString()
Get the textual representation of the address object. The format of the returned string is: <address-plan>: <address-string>
Overrides:
toString in class java.lang.Object
Returns:
the textual representation of the address object.