|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.objectxp.mms.MMSAddress
This class represents an MMS address.
A MMS address consists of either an email address or a device address. The syntax for email addresses is defined in RFC822. Device addresses consist of an address and a address type.
The following address types are defined:
MAIL: An email addressPLMN: A global phone numberIPv4: An IPv4 addressIPv6: An IPv6 addressHere are some examples of valid MMS addresses:
0401234567/TYPE=PLMN +358501234567/TYPE=PLMN "Joe User" <joe@user.org> FEDC:BA98:7654:3210:FEDC:BA98:7654:3210/TYPE=IPv6 192.168.1.30/TYPE=IPv4
| Field Summary | |
static int |
TYPE_CUSTOM
Custom address type. |
static int |
TYPE_EMAIL
eMail address type. |
static int |
TYPE_IPV4
IPv4 address type. |
static int |
TYPE_IPV6
IPv6 address type. |
static int |
TYPE_PLMN
global-phone-number address type. |
| Constructor Summary | |
MMSAddress(int type,
java.lang.String address)
Construct a MMSAddress of a given type. |
|
MMSAddress(java.lang.String address)
Construct an MMSAddress. |
|
| Method Summary | |
boolean |
equals(java.lang.Object obj)
Compares this MMSAddress to the specified object. |
int |
getType()
Get the Type of the Address. |
java.lang.String |
getValue()
Get the value of the Address. |
int |
hashCode()
Returns a hashcode for this address. |
java.lang.String |
toString()
Returns the complete MMS address as String (including the type). |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int TYPE_EMAIL
public static final int TYPE_PLMN
public static final int TYPE_IPV4
public static final int TYPE_IPV6
public static final int TYPE_CUSTOM
| Constructor Detail |
public MMSAddress(java.lang.String address)
throws java.lang.IllegalArgumentException,
java.lang.NullPointerException
/TYPE=...)
is not specified, the type is determined automatically.
Examples:
new MMSAddress("+41123456789");
new MMSAddress("john@user.org");
new MMSAddress("192.168.1.12");
new MMSAddress("0123765/TYPE=PLMN");
address - the MMS address.
java.lang.IllegalArgumentException - if the type of address cannot be determined.
java.lang.NullPointerException - if the address is null.
public MMSAddress(int type,
java.lang.String address)
throws java.lang.IllegalArgumentException
Examples:
new MMSAddress(MMSAddress.TYPE_EMAIL, "\"John User\" <john@user.org>"); new MMSAddress(MMSAddress.TYPE_PLMN, "+41123456789"); new MMSAddress(MMSAddress.TYPE_IPV4, "129.168.1.55"); new MMSAddress(MMSAddress.TYPE_CUSTOM, "471129/TYPE=UID");
type - the address type (one of the TYPE_... constants).address - the MMS address.
java.lang.IllegalArgumentException - if an unknown type is used.
java.lang.IllegalArgumentException - if the address doesn't match the type.
java.lang.IllegalArgumentException - if the address is empty.| Method Detail |
public java.lang.String getValue()
public int getType()
public java.lang.String toString()
String (including the type).
public boolean equals(java.lang.Object obj)
true if and only if the argument is not
null and is a MMSAddress object that contains
the same address type and value.
obj - the object to compare this MMSAddress against.
true if the MMSAddress is equal;
false otherwise.public int hashCode()
MMSAddress object is computed by calling hashCode()
on the String returned by toString(). If
getMMSAddress returns null, super.hashCode() is
returned instead.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||