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 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
getNamespace()
Returns the root element XML namespace.String
getUser()
Deprecated.usegetJid()
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(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:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in 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)
-
-