public class RosterGroup extends Manager
Roster.getGroup(String)
Modifier and Type | Method and Description |
---|---|
void |
addEntry(RosterEntry entry)
Adds a roster entry to this group.
|
boolean |
contains(RosterEntry entry)
Returns true if the specified entry is part of this group.
|
boolean |
contains(String user)
Returns true if the specified XMPP address is an entry in this group.
|
List<RosterEntry> |
getEntries()
Returns an copied list of all entries in the group.
|
RosterEntry |
getEntry(String user)
Returns the roster entry associated with the given XMPP address or
null if the user is not an entry in the group.
|
int |
getEntryCount()
Returns the number of entries in the group.
|
String |
getName()
Returns the name of the group.
|
void |
removeEntry(RosterEntry entry)
Removes a roster entry from this group.
|
void |
setName(String name)
Sets the name of the group.
|
connection
public void setName(String name) throws SmackException.NotConnectedException, SmackException.NoResponseException, XMPPException.XMPPErrorException
name
- the name of the group.SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
public int getEntryCount()
public List<RosterEntry> getEntries()
public RosterEntry getEntry(String user)
user
- the XMPP address of the user (eg "jsmith@example.com").public boolean contains(RosterEntry entry)
entry
- a roster entry.public boolean contains(String user)
user
- the XMPP address of the user.public void addEntry(RosterEntry entry) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
entry
- a roster entry.XMPPException.XMPPErrorException
- if an error occured while trying to add the entry to the group.SmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException
public void removeEntry(RosterEntry entry) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
entry
- a roster entry.XMPPException.XMPPErrorException
- if an error occurred while trying to remove the entry from the group.SmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException