|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.rim.pushsdk.pap.control.AddressList
public class AddressList
Represents a list of addresses (e.g. PINs, email addresses, etc.).
| Field Summary | |
|---|---|
static String |
BES_ADDRESS_PREFIX
Each BES address in PAP must have the specified prefix. |
static String |
BES_ADDRESS_SUFFIX
Each BES address in PAP must have the specified suffix. |
static String |
BES_PUSH_ALL_NOT_ALLOWED_ERROR_MSG
Error message indicating that enterprise (BES) does not support performing a push_all. |
static String |
PUSH_ALL
Deprecated. Use Constants.PUSH_ALL instead. |
| Constructor Summary | |
|---|---|
AddressList()
Default address list constructor. |
|
AddressList(boolean shouldPushAll)
Constructs an address list with the push_all token, if the given boolean is set to true. |
|
AddressList(String address)
Constructs an address list with a single address. |
|
| Method Summary | |
|---|---|
void |
add(String address)
Adds an address to the address list. |
void |
add(String address,
boolean parseBESAddress)
Adds an address to the address list and parses it as a enterprise (BES) address if requested. |
void |
addAll(Collection<String> addresses)
Adds a collection of addresses to the address list. |
void |
clear()
Clears the address list of all the existing addresses. |
boolean |
contains(String address)
Whether or not the address list contains the specified address. |
boolean |
containsAll(Collection<String> addresses)
Whether or not the address list contains the collection of addresses. |
boolean |
equals(Object obj)
Returns true if two address lists are found to be equal and false otherwise. |
static String |
formatBESAddress(String address)
Formats an address so that it is in the expected format for a PAP push sent through enterprise (BES). |
int |
hashCode()
Returns a hashcode for this address list. |
boolean |
isEmpty()
Whether or not the address list is empty. |
static boolean |
isPushAll(List<String> addresses)
Determines if the list of addresses is a push_all (i.e. |
static boolean |
isPushAll(String address)
Determines if the address is the push_all token (the case is ignored). |
static String |
parseBESAddress(String address)
Parses out the address from how it appears in a PAP push sent through enterprise (BES). |
String |
print()
Deprecated. As of release 1.1, replaced by print(boolean). |
String |
print(boolean usingPublicPush)
Returns a string containing the address list wrapped in PAP XML tags. |
boolean |
remove(String address)
Removes an address from the address list. |
boolean |
removeAll(Collection<String> addresses)
Removes a collection of addresses from the address list. |
boolean |
retainAll(Collection<String> addresses)
Retains only those addresses in the address list that are also in the specified collection of addresses. |
void |
setPushSDKProperties(PushSDKProperties pushSDKProperties)
Deprecated. As of release 1.1, replaced by print(boolean) and validate(boolean, boolean) for indicating
whether this address list applies to a public (BIS) operation or an enterprise (BES) operation. |
int |
size()
Gets the size of the address list. |
String[] |
toArray()
Gets the address list as an array of addresses (strings). |
List<String> |
toList()
Gets the address list as a list of addresses (strings). |
Set<String> |
toSet()
Gets the address list as a set of addresses (strings). |
String |
toString()
Constructs a String with all attributes in name = value format. |
void |
validate()
Deprecated. As of release 1.1, replaced by validate(boolean, boolean). |
void |
validate(boolean allowPushAll)
Deprecated. As of release 1.1, replaced by validate(boolean, boolean). |
void |
validate(boolean usingPublicPush,
boolean allowPushAll)
Validates an address list: - Verify that the address list is not empty. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PUSH_ALL
Constants.PUSH_ALL instead.public static final String BES_PUSH_ALL_NOT_ALLOWED_ERROR_MSG
public static final String BES_ADDRESS_PREFIX
public static final String BES_ADDRESS_SUFFIX
| Constructor Detail |
|---|
public AddressList()
public AddressList(String address)
address - an addresspublic AddressList(boolean shouldPushAll)
shouldPushAll - whether or not a push all is requested| Method Detail |
|---|
@Deprecated public void setPushSDKProperties(PushSDKProperties pushSDKProperties)
print(boolean) and validate(boolean, boolean) for indicating
whether this address list applies to a public (BIS) operation or an enterprise (BES) operation.
pushSDKProperties - the push SDK propertiespublic void add(String address)
address - the address to add
public void add(String address,
boolean parseBESAddress)
address - the address to addparseBESAddress - true if the address should be parsed as an enterprise (BES) address; false otherwisepublic void addAll(Collection<String> addresses)
addresses - a collection of addresses to addpublic boolean removeAll(Collection<String> addresses)
addresses - a collection of addresses to remove
public boolean remove(String address)
address - the address to remove
public boolean contains(String address)
address - an address
public boolean containsAll(Collection<String> addresses)
addresses - a collection of addresses
public boolean retainAll(Collection<String> addresses)
addresses - a collection of addresses
public void clear()
public boolean isEmpty()
public int size()
public List<String> toList()
public Set<String> toSet()
public String[] toArray()
public static boolean isPushAll(List<String> addresses)
Constants.PUSH_ALL.
addresses - the addresses to check
public static boolean isPushAll(String address)
address - the address to check
@Deprecated public String print()
print(boolean).
public String print(boolean usingPublicPush)
usingPublicPush - true if the address list is for a public (BIS) operation; false otherwise
public static String formatBESAddress(String address)
address - the address to be formatted
public static String parseBESAddress(String address)
address - the address formatted for a BES push
@Deprecated public void validate()
validate(boolean, boolean).
validate(boolean) method with the allowPushAll argument set to true.
@Deprecated public void validate(boolean allowPushAll)
validate(boolean, boolean).
allowPushAll is set to false, that the address list does not contain the push_all token.
allowPushAll - whether a push_all is allowed
public void validate(boolean usingPublicPush,
boolean allowPushAll)
allowPushAll is set to false, that the address list does not contain the push_all token. usingPublicPush is set to false, the push_all token is not in the address list.
usingPublicPush - true if the address list is for a public (BIS) operation; false otherwiseallowPushAll - whether a push_all is allowedpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
String with all attributes in name = value format.
toString in class ObjectString representation of this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||