Class RosterPacket.Item
java.lang.Object
org.jivesoftware.smack.roster.packet.RosterPacket.Item
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.ExtensionElement,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlElement,org.jivesoftware.smack.packet.XmlLangElement
- Enclosing class:
- RosterPacket
public static final class RosterPacket.Item
extends Object
implements org.jivesoftware.smack.packet.ExtensionElement
A roster item, which consists of a JID, their name, the type of subscription, and
the groups the roster item belongs to.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroupName(String groupName) Adds a group name.booleanReturns an unmodifiable set of the group names that the roster item belongs to.Returns the roster item type.org.jxmpp.jid.BareJidgetJid()Returns the JID of this item.getName()Returns the user's name.getUser()Deprecated.inthashCode()booleanReturns the roster item pre-approval state.booleanvoidremoveGroupName(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.voidSets the user's name.voidsetSubscriptionPending(boolean subscriptionPending) org.jivesoftware.smack.util.XmlStringBuildertoXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.Element
toXML, toXMLMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
ELEMENT
The constant value ""item"".- See Also:
-
QNAME
-
GROUP
- See Also:
-
-
Constructor Details
-
Item
Creates a new roster item.- Parameters:
jid- TODO javadoc me pleasename- TODO javadoc me please
-
Item
Creates a new roster item.- Parameters:
jid- the jid.name- the user's name.subscriptionPending- TODO javadoc me please
-
-
Method Details
-
getElementName
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.XmlElement
-
getUser
Deprecated.usegetJid()instead.Returns the user.- Returns:
- the user.
-
getJid
public org.jxmpp.jid.BareJid getJid()Returns the JID of this item.- Returns:
- the JID.
-
getName
Returns the user's name.- Returns:
- the user's name.
-
setName
Sets the user's name.- Parameters:
name- the user's name.
-
getItemType
Returns the roster item type.- Returns:
- the roster item type.
-
setItemType
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
Returns an unmodifiable set of the group names that the roster item belongs to.- Returns:
- an unmodifiable set of the group names.
-
addGroupName
Adds a group name.- Parameters:
groupName- the group name.
-
removeGroupName
Removes a group name.- Parameters:
groupName- the group name.
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) - Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-
hashCode
public int hashCode() -
equals
-
getJid()instead.