Interface Buddy

  • All Known Implementing Classes:
    SFSBuddy

    public interface Buddy
    The Buddy interface defines all the methods and properties that an object representing a SmartFoxServer Buddy entity exposes.

    In the SmartFoxServer 2X client API this interface is implemented by the SFSBuddy class. Read the class description for additional informations.

    See Also:
    SFSBuddy
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clearVolatileVariables()
      * API internal usage only *
      boolean containsVariable​(java.lang.String varName)
      Indicates whether this buddy has the specified Buddy Variable set or not.
      int getId()
      Indicates the id of this buddy.
      java.lang.String getName()
      Indicates the name of this buddy.
      java.lang.String getNickName()
      Returns the nickname of this buddy.
      java.util.List<BuddyVariable> getOfflineVariables()
      Retrieves the list of persistent Buddy Variables of this buddy.
      java.util.List<BuddyVariable> getOnlineVariables()
      Retrieves the list of non-persistent Buddy Variables of this buddy.
      java.lang.String getState()
      Returns the custom state of this buddy.
      BuddyVariable getVariable​(java.lang.String varName)
      Retrieves a Buddy Variable from its name.
      java.util.List<BuddyVariable> getVariables()
      Returns a list of BuddyVariable objects associated with the buddy.
      boolean isBlocked()
      Indicates whether this buddy is blocked in the current user's buddies list or not.
      boolean isOnline()
      Indicates whether this buddy is online in the Buddy List system or not.
      boolean isTemp()
      Indicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not.
      void removeVariable​(java.lang.String varName)
      * API internal usage only *
      void setBlocked​(boolean blocked)
      * API internal usage only *
      void setId​(int id)
      * API internal usage only *
      void setVariable​(BuddyVariable bVar)
      * API internal usage only *
      void setVariables​(java.util.List<BuddyVariable> variables)
      * API internal usage only *
    • Method Detail

      • getId

        int getId()
        Indicates the id of this buddy. This is equal to the id assigned by SmartFoxServer to the corresponding user.
        See Also:
        User.getId()
      • getName

        java.lang.String getName()
        Indicates the name of this buddy. This is equal to the name of the corresponding user.
        See Also:
        User.getName()
      • isBlocked

        boolean isBlocked()
        Indicates whether this buddy is blocked in the current user's buddies list or not. A buddy can be blocked by means of a BlockBuddyRequest request.
        See Also:
        BlockBuddyRequest
      • isOnline

        boolean isOnline()
        Indicates whether this buddy is online in the Buddy List system or not.
      • isTemp

        boolean isTemp()
        Indicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not.
      • getState

        java.lang.String getState()
        Returns the custom state of this buddy. Examples of custom states are "Available", "Busy", "Be right back", etc. If the custom state is not set, null is returned.

        The list of available custom states is returned by the IBuddyManager.buddyStates property.

        See Also:
        IBuddyManager.getBuddyStates()
      • getNickName

        java.lang.String getNickName()
        Returns the nickname of this buddy. If the nickname is not set, null is returned.
      • getVariable

        BuddyVariable getVariable​(java.lang.String varName)
        Retrieves a Buddy Variable from its name.
        Parameters:
        varName - The name of the Buddy Variable to be retrieved.
        Returns:
        The BuddyVariable object representing the Buddy Variable, or null if no Buddy Variable with the passed name is associated with this buddy.
        See Also:
        getVariables(), SetBuddyVariablesRequest
      • containsVariable

        boolean containsVariable​(java.lang.String varName)
        Indicates whether this buddy has the specified Buddy Variable set or not.
        Parameters:
        varName - The name of the Buddy Variable whose existence must be checked.
        Returns:
        true if a Buddy Variable with the passed name is set for this buddy.
      • getOfflineVariables

        java.util.List<BuddyVariable> getOfflineVariables()
        Retrieves the list of persistent Buddy Variables of this buddy.
        Returns:
        A List of BuddyVariable objects.
        See Also:
        BuddyVariable.isOffline()
      • getOnlineVariables

        java.util.List<BuddyVariable> getOnlineVariables()
        Retrieves the list of non-persistent Buddy Variables of this buddy.
        Returns:
        A List of BuddyVariable objects.
        See Also:
        BuddyVariable.isOffline()
      • setVariable

        void setVariable​(BuddyVariable bVar)
        * API internal usage only *
      • setVariables

        void setVariables​(java.util.List<BuddyVariable> variables)
        * API internal usage only *
      • setId

        void setId​(int id)
        * API internal usage only *
      • setBlocked

        void setBlocked​(boolean blocked)
        * API internal usage only *
      • removeVariable

        void removeVariable​(java.lang.String varName)
        * API internal usage only *
      • clearVolatileVariables

        void clearVolatileVariables()
        * API internal usage only *