Class RosterPacket.Item
- java.lang.Object
-
- org.jivesoftware.smack.roster.packet.RosterPacket.Item
-
- All Implemented Interfaces:
Element,ExtensionElement,FullyQualifiedElement,NamedElement,XmlLangElement
- Enclosing class:
- RosterPacket
public static final class RosterPacket.Item extends Object implements ExtensionElement
A roster item, which consists of a JID, their name, the type of subscription, and the groups the roster item belongs to.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddGroupName(String groupName)Adds a group name.booleanequals(Object obj)StringgetElementName()Returns the root element name.Set<String>getGroupNames()Returns an unmodifiable set of the group names that the roster item belongs to.RosterPacket.ItemTypegetItemType()Returns the roster item type.BareJidgetJid()Returns the JID of this item.StringgetName()Returns the user's name.StringgetNamespace()Returns the root element XML namespace.StringgetUser()Deprecated.usegetJid()instead.inthashCode()booleanisApproved()Returns the roster item pre-approval state.booleanisSubscriptionPending()voidremoveGroupName(String groupName)Removes a group name.voidsetApproved(boolean approved)Sets the roster item pre-approval state.voidsetItemType(RosterPacket.ItemType itemType)Sets the roster item type.voidsetName(String name)Sets the user's name.voidsetSubscriptionPending(boolean subscriptionPending)XmlStringBuildertoXML(XmlEnvironment enclosingNamespace)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final String ELEMENT
The constant value ""item"".- See Also:
- Constant Field Values
-
GROUP
public static final String GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getElementName
public String getElementName()
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
public String getNamespace()
Description copied from interface:FullyQualifiedElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceFullyQualifiedElement- Returns:
- the namespace.
-
getUser
@Deprecated public String getUser()
Deprecated.usegetJid()instead.Returns the user.- Returns:
- the user.
-
getItemType
public RosterPacket.ItemType getItemType()
Returns the roster item type.- Returns:
- the roster item type.
-
setItemType
public void setItemType(RosterPacket.ItemType itemType)
Sets the roster item type.- Parameters:
itemType- the roster item type.
-
setSubscriptionPending
public void setSubscriptionPending(boolean subscriptionPending)
-
isSubscriptionPending
public boolean isSubscriptionPending()
-
isApproved
public boolean isApproved()
Returns the roster item pre-approval state.- Returns:
- the pre-approval state.
-
setApproved
public void setApproved(boolean approved)
Sets the roster item pre-approval state.- Parameters:
approved- the pre-approval flag.
-
getGroupNames
public Set<String> getGroupNames()
Returns an unmodifiable set of the group names that the roster item belongs to.- Returns:
- an unmodifiable set of the group names.
-
addGroupName
public void addGroupName(String groupName)
Adds a group name.- Parameters:
groupName- the group name.
-
removeGroupName
public void removeGroupName(String groupName)
Removes a group name.- Parameters:
groupName- the group name.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
-