javax.slee
Class AddressPresentation

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

public final class AddressPresentation
extends java.lang.Object
implements java.io.Serializable

This class defines an enumerated type that encapsulates the values available for address presentation to other call parties. The user application uses an address presentation attribute to determine whether an address is to be presented to end users.

A singleton instance of each enumerated value is guaranteed (via an implementation of readResolve() - refer java.io.Serializable), so that equality tests using == are always evaluated correctly. (This equality test is only guaranteed if this class is loaded in the application's boot class path, rather than dynamically loaded at runtime.)

See Also:
Address, Serialized Form

Field Summary
static AddressPresentation ADDRESS_NOT_AVAILABLE
          The ADDRESS_NOT_AVAILABLE value indicates that the address is not available for presentation.
static int ADDRESS_PRESENTATION_ADDRESS_NOT_AVAILABLE
          An integer representation of ADDRESS_NOT_AVAILABLE.
static int ADDRESS_PRESENTATION_ALLOWED
          An integer representation of ALLOWED.
static int ADDRESS_PRESENTATION_RESTRICTED
          An integer representation of RESTRICTED.
static int ADDRESS_PRESENTATION_UNDEFINED
          An integer representation of UNDEFINED.
static AddressPresentation ALLOWED
          The ALLOWED value indicates that the address presentation is allowed.
static AddressPresentation RESTRICTED
          The RESTRICTED value indicates that the address presentation is restricted.
static AddressPresentation UNDEFINED
          The UNDEFINED value indicates that the address presentation is undefined.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this address presentation for equality with another.
static AddressPresentation fromInt(int value)
          Get an AddressPresentation object from an integer value.
 int hashCode()
          Get a hash code value for this address presentation.
 boolean isAddressNotAvailable()
          Determine if this AddressPresentation object represents the ADDRESS_NOT_AVAILABLE address presentation value.
 boolean isAllowed()
          Determine if this AddressPresentation object represents the ALLOWED address presentation value.
 boolean isRestricted()
          Determine if this AddressPresentation object represents the RESTRICTED address presentation value.
 boolean isUndefined()
          Determine if this AddressPresentation object represents the UNDEFINED address presentation value.
 int toInt()
          Get an integer value representation for this AddressPresentation object.
 java.lang.String toString()
          Get the textual representation of the address presentation object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ADDRESS_PRESENTATION_UNDEFINED

public static final int ADDRESS_PRESENTATION_UNDEFINED
An integer representation of UNDEFINED.

ADDRESS_PRESENTATION_ALLOWED

public static final int ADDRESS_PRESENTATION_ALLOWED
An integer representation of ALLOWED.

ADDRESS_PRESENTATION_RESTRICTED

public static final int ADDRESS_PRESENTATION_RESTRICTED
An integer representation of RESTRICTED.

ADDRESS_PRESENTATION_ADDRESS_NOT_AVAILABLE

public static final int ADDRESS_PRESENTATION_ADDRESS_NOT_AVAILABLE
An integer representation of ADDRESS_NOT_AVAILABLE.

UNDEFINED

public static final AddressPresentation UNDEFINED
The UNDEFINED value indicates that the address presentation is undefined.

ALLOWED

public static final AddressPresentation ALLOWED
The ALLOWED value indicates that the address presentation is allowed.

RESTRICTED

public static final AddressPresentation RESTRICTED
The RESTRICTED value indicates that the address presentation is restricted.

ADDRESS_NOT_AVAILABLE

public static final AddressPresentation ADDRESS_NOT_AVAILABLE
The ADDRESS_NOT_AVAILABLE value indicates that the address is not available for presentation.
Method Detail

fromInt

public static AddressPresentation fromInt(int value)
                                   throws java.lang.IllegalArgumentException
Get an AddressPresentation object from an integer value.
Parameters:
value - the address presentation value as an integer.
Returns:
an AddressPresentation object corresponding to value.
Throws:
java.lang.IllegalArgumentException - if value is not a valid address presentation value.

toInt

public int toInt()
Get an integer value representation for this AddressPresentation object.
Returns:
an integer value representation for this AddressPresentation object.

isUndefined

public boolean isUndefined()
Determine if this AddressPresentation object represents the UNDEFINED address presentation value.

This method is effectively equivalent to the conditional test: (this == UNDEFINED), ie. the code:

    if (presentation.isUndefined()) ...

is interchangeable with the code:

   if (presentation == AddressPresentation.UNDEFINED) ...

Returns:
true if this object represents the UNDEFINED address presentation value, false otherwise.

isAllowed

public boolean isAllowed()
Determine if this AddressPresentation object represents the ALLOWED address presentation value.

This method is effectively equivalent to the conditional test: (this == ALLOWED), ie. the code:

    if (presentation.isAllowed()) ...

is interchangeable with the code:

   if (presentation == AddressPresentation.ALLOWED) ...

Returns:
true if this object represents the ALLOWED address presentation value, false otherwise.

isRestricted

public boolean isRestricted()
Determine if this AddressPresentation object represents the RESTRICTED address presentation value.

This method is effectively equivalent to the conditional test: (this == RESTRICTED), ie. the code:

    if (presentation.isRestricted()) ...

is interchangeable with the code:

   if (presentation == AddressPresentation.RESTRICTED) ...

Returns:
true if this object represents the RESTRICTED address presentation value, false otherwise.

isAddressNotAvailable

public boolean isAddressNotAvailable()
Determine if this AddressPresentation object represents the ADDRESS_NOT_AVAILABLE address presentation value.

This method is effectively equivalent to the conditional test: (this == ADDRESS_NOT_AVAILABLE), ie. the code:

    if (presentation.isAddressNotAvailable()) ...

is interchangeable with the code:

   if (presentation == AddressPresentation.ADDRESS_NOT_AVAILABLE) ...

Returns:
true if this object represents the ADDRESS_NOT_AVAILABLE address presentation value, false otherwise.

equals

public boolean equals(java.lang.Object obj)
Compare this address presentation 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 representing the same address presentation value as this, false otherwise.

hashCode

public int hashCode()
Get a hash code value for this address presentation.
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 presentation object.
Overrides:
toString in class java.lang.Object
Returns:
the textual representation of the address presentation object.