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 java.lang.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(java.lang.String groupName)Adds a group name.booleanequals(java.lang.Object obj)java.lang.StringgetElementName()Returns the root element name.java.util.Set<java.lang.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.java.lang.StringgetName()Returns the user's name.java.lang.StringgetNamespace()Returns the root element XML namespace.java.lang.StringgetUser()Deprecated.usegetJid()instead.inthashCode()booleanisApproved()Returns the roster item pre-approval state.booleanisSubscriptionPending()voidremoveGroupName(java.lang.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(java.lang.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 java.lang.String ELEMENT
The constant value ""item"".- See Also:
- Constant Field Values
-
QNAME
public static final javax.xml.namespace.QName QNAME
-
GROUP
public static final java.lang.String GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceFullyQualifiedElement- Returns:
- the namespace.
-
getUser
@Deprecated public java.lang.String getUser()
Deprecated.usegetJid()instead.Returns the user.- Returns:
- the user.
-
getName
public java.lang.String getName()
Returns the user's name.- Returns:
- the user's name.
-
setName
public void setName(java.lang.String name)
Sets the user's name.- Parameters:
name- the user's name.
-
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 java.util.Set<java.lang.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(java.lang.String groupName)
Adds a group name.- Parameters:
groupName- the group name.
-
removeGroupName
public void removeGroupName(java.lang.String groupName)
Removes a group name.- Parameters:
groupName- the group name.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-