tigase.jaxmpp.core.client.xmpp.modules.roster

## Class RosterItem

- java.lang.Object
- - tigase.jaxmpp.core.client.xmpp.modules.roster.RosterItem

-     public class RosterItem
      extends Object

  Roster item. Contains information about buddy in roster.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RosterItem.Subscription` Susbcription state.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ID_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RosterItem(BareJID jid, SessionObject sessionObject)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `<T> T` | `getData(String key)` Returns object stored by setData(String, Object).
    `ArrayList<String>` | `getGroups()` Returns groups associated to roster item.
    `long` | `getId()` Returns internal RosterItem object ID.
    `BareJID` | `getJid()` Returns JID of buddy.
    `String` | `getName()` Returns name of buddy.
    `SessionObject` | `getSessionObject()` Returns session object related to roster item.
    `RosterItem.Subscription` | `getSubscription()` Returns subscription state.
    `int` | `hashCode()`
    `boolean` | `isApproved()`
    `boolean` | `isAsk()` Checks if subscription was requested.
    `<T> T` | `removeData(String key)` Removes data stored by setData(String, Object).
    `void` | `setApproved(boolean approved)`
    `void` | `setAsk(boolean ask)`
    `void` | `setData(String key, Object value)` Store object in roster item.
    `void` | `setName(String name)`
    `void` | `setSubscription(RosterItem.Subscription subscription)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ID_KEY

          public static final String ID_KEY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RosterItem

          public RosterItem(BareJID jid,
                            SessionObject sessionObject)

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getData

          public <T> T getData(String key)

      Returns object stored by setData(String, Object).
      Parameters:
        `key` - the key whose associated value is to be returned
      Returns:
        object or `null` if object doesn't exists.

    - #### getGroups

          public ArrayList<String> getGroups()

      Returns groups associated to roster item.
      Returns:

    - #### getId

          public long getId()

      Returns internal RosterItem object ID.
      Returns:
        object id.

    - #### getJid

          public BareJID getJid()

      Returns JID of buddy.
      Returns:
        JID of buddy.

    - #### getName

          public String getName()

      Returns name of buddy.
      Returns:
        name of buddy.

    - #### setName

          public void setName(String name)

    - #### getSessionObject

          public SessionObject getSessionObject()

      Returns session object related to roster item.
      Returns:
        session object.

    - #### getSubscription

          public RosterItem.Subscription getSubscription()

      Returns subscription state.
      Returns:
        subscription state.

    - #### setSubscription

          public void setSubscription(RosterItem.Subscription subscription)

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### isApproved

          public boolean isApproved()

    - #### setApproved

          public void setApproved(boolean approved)

    - #### isAsk

          public boolean isAsk()

      Checks if subscription was requested.
      Returns:
        `true` subscription of this buddy was requested.

    - #### setAsk

          public void setAsk(boolean ask)

    - #### removeData

          public <T> T removeData(String key)

      Removes data stored by setData(String, Object).
      Parameters:
        `key` - the key whose associated value is to be removed
      Returns:
        removed value or `null` if value was not saved.

    - #### setData

          public void setData(String key,
                              Object value)

      Store object in roster item. Object will not be stored on server or in local cache.
      Parameters:
        `key` - the key whose associated value is to be saved
        `value` - values to save

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2006–2020 Tigase. All rights reserved.