public class Contacts extends java.lang.Object implements MapEventDispatcher.MapEventDispatchListener
Modifier and Type | Class and Description |
---|---|
static interface |
Contacts.OnContactsChangedListener |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
static java.lang.String |
TEAM_GROUPS |
static java.lang.String |
USER_GROUPS |
Modifier and Type | Method and Description |
---|---|
void |
addContact(Contact contact) |
void |
addContact(GroupContact parent,
Contact contact)
Add contact to collection of contacts
|
void |
addListener(Contacts.OnContactsChangedListener listener)
Adds a listener for when the Contact list or a specific contact is changed
|
static android.os.Bundle |
buildPaths(Contact group)
Create a paths bundle for everything under this group
Meant to be called on user groups only
|
void |
dispose() |
static java.util.List<Contact> |
fromUIDs(java.util.List<java.lang.String> uids) |
java.util.List<Contact> |
getAllContacts()
Get a copy of all contacts, so it can be used without violating thread
safety.
|
java.util.List<java.lang.String> |
getAllContactsInTeam(java.lang.String team) |
java.util.List<java.lang.String> |
getAllContactsWithRole(java.lang.String role) |
java.util.List<java.lang.String> |
getAllContactUuids()
Get uuids of all the contacts.
|
java.util.List<java.lang.String> |
getAllIndividualContactUuids() |
Contact |
getContactByUuid(java.lang.String uuid)
Iterate through contacts to find contact with specified uuid.
|
Contact |
getFirstContactWithCallsign(java.lang.String callsign)
Iterate through contacts and find first contact with specified name.
|
IndividualContact[] |
getIndividualContactsByUuid(java.util.List<java.lang.String> uuids)
Iterate through contacts to find contacts with specified uuids.
|
static Contacts |
getInstance() |
GroupContact |
getRootGroup() |
void |
onMapEvent(MapEvent event) |
void |
removeContact(Contact contact)
Remove contact from collection of contacts
|
void |
removeContactByUuid(java.lang.String uuid) |
void |
removeListener(Contacts.OnContactsChangedListener listener)
Removes the listener for when the Contact list or a specific contact is changed
|
static java.util.List<java.lang.String> |
toUIDs(java.util.List<Contact> contacts) |
void |
updateTotalUnreadCount() |
boolean |
validContact(Contact c)
Check if the supplied contact is registered (valid)
|
public static final java.lang.String TAG
public static final java.lang.String USER_GROUPS
public static final java.lang.String TEAM_GROUPS
public static Contacts getInstance()
public GroupContact getRootGroup()
public boolean validContact(Contact c)
c
- Contact objectpublic void addContact(GroupContact parent, Contact contact)
contact
- Contact to addpublic void addContact(Contact contact)
public void removeContact(Contact contact)
contact
- Contact to removepublic void removeContactByUuid(java.lang.String uuid)
public static java.util.List<Contact> fromUIDs(java.util.List<java.lang.String> uids)
public static java.util.List<java.lang.String> toUIDs(java.util.List<Contact> contacts)
public java.util.List<Contact> getAllContacts()
public java.util.List<java.lang.String> getAllIndividualContactUuids()
public Contact getContactByUuid(java.lang.String uuid)
uuid
- the unique identifier to usepublic static android.os.Bundle buildPaths(Contact group)
group
- Group contactpublic IndividualContact[] getIndividualContactsByUuid(java.util.List<java.lang.String> uuids)
uuids
- List of UUIDs to findpublic Contact getFirstContactWithCallsign(java.lang.String callsign)
callsign
- the callsign to use in the searchpublic java.util.List<java.lang.String> getAllContactsInTeam(java.lang.String team)
public java.util.List<java.lang.String> getAllContactsWithRole(java.lang.String role)
public java.util.List<java.lang.String> getAllContactUuids()
public void updateTotalUnreadCount()
public void addListener(Contacts.OnContactsChangedListener listener)
listener
- the listener for the event.public void removeListener(Contacts.OnContactsChangedListener listener)
listener
- the listener for the event.public void dispose()
public void onMapEvent(MapEvent event)
onMapEvent
in interface MapEventDispatcher.MapEventDispatchListener