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 Details

  • Constructor Details

    • Item

      public Item(org.jxmpp.jid.BareJid jid, String name)
      Creates a new roster item.
      Parameters:
      jid - TODO javadoc me please
      name - TODO javadoc me please
    • Item

      public Item(org.jxmpp.jid.BareJid jid, String name, boolean subscriptionPending)
      Creates a new roster item.
      Parameters:
      jid - the jid.
      name - the user's name.
      subscriptionPending - TODO javadoc me please
  • Method Details

    • getElementName

      public String getElementName()
      Specified by:
      getElementName in interface org.jivesoftware.smack.packet.NamedElement
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface org.jivesoftware.smack.packet.XmlElement
    • getUser

      @Deprecated public String getUser()
      Deprecated.
      use getJid() instead.
      Returns the user.
      Returns:
      the user.
    • getJid

      public org.jxmpp.jid.BareJid getJid()
      Returns the JID of this item.
      Returns:
      the JID.
    • getName

      public String getName()
      Returns the user's name.
      Returns:
      the user's name.
    • setName

      public void setName(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 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 org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
      Specified by:
      toXML in interface org.jivesoftware.smack.packet.Element
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object