public static class RosterPacket.Item extends Object implements NamedElement
Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT
The constant value ""item"".
|
static String |
GROUP |
Constructor and Description |
---|
Item(BareJid jid,
String name)
Creates a new roster item.
|
Item(BareJid jid,
String name,
boolean subscriptionPending)
Creates a new roster item.
|
Modifier and Type | Method and Description |
---|---|
void |
addGroupName(String groupName)
Adds a group name.
|
boolean |
equals(Object obj) |
String |
getElementName()
Returns the root element name.
|
Set<String> |
getGroupNames()
Returns an unmodifiable set of the group names that the roster item
belongs to.
|
RosterPacket.ItemType |
getItemType()
Returns the roster item type.
|
BareJid |
getJid()
Returns the JID of this item.
|
String |
getName()
Returns the user's name.
|
String |
getUser()
Deprecated.
use
getJid() instead. |
int |
hashCode() |
boolean |
isApproved()
Returns the roster item pre-approval state.
|
boolean |
isSubscriptionPending() |
void |
removeGroupName(String groupName)
Removes a group name.
|
void |
setApproved(boolean approved)
Sets the roster item pre-approval state.
|
void |
setItemType(RosterPacket.ItemType itemType)
Sets the roster item type.
|
void |
setName(String name)
Sets the user's name.
|
void |
setSubscriptionPending(boolean subscriptionPending) |
XmlStringBuilder |
toXML(String enclosingNamespace)
Returns the XML representation of this Element.
|
public static final String ELEMENT
public static final String GROUP
public String getElementName()
NamedElement
getElementName
in interface NamedElement
@Deprecated public String getUser()
getJid()
instead.public RosterPacket.ItemType getItemType()
public void setItemType(RosterPacket.ItemType itemType)
itemType
- the roster item type.public void setSubscriptionPending(boolean subscriptionPending)
public boolean isSubscriptionPending()
public boolean isApproved()
public void setApproved(boolean approved)
approved
- the pre-approval flag.public Set<String> getGroupNames()
public void addGroupName(String groupName)
groupName
- the group name.public void removeGroupName(String groupName)
groupName
- the group name.public XmlStringBuilder toXML(String enclosingNamespace)
Element