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 void
addGroupName(java.lang.String groupName)
Adds a group name.boolean
equals(java.lang.Object obj)
java.lang.String
getElementName()
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.ItemType
getItemType()
Returns the roster item type.BareJid
getJid()
Returns the JID of this item.java.lang.String
getName()
Returns the user's name.java.lang.String
getNamespace()
Returns the root element XML namespace.java.lang.String
getUser()
Deprecated.usegetJid()
instead.int
hashCode()
boolean
isApproved()
Returns the roster item pre-approval state.boolean
isSubscriptionPending()
void
removeGroupName(java.lang.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(java.lang.String name)
Sets the user's name.void
setSubscriptionPending(boolean subscriptionPending)
XmlStringBuilder
toXML(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:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in 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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-