Package sfs3.client.entities
Class SFSBuddy
java.lang.Object
sfs3.client.entities.SFSBuddy
- All Implemented Interfaces:
Buddy
The SFSBuddy object represents a buddy in the current user's buddy list.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancontainsVariable(String varName) Indicates whether this buddy has the specified Buddy Variable set or not.booleanstatic BuddyfromSFSArray(ISFSArray arr) If a Buddy nickname exists returns that nickname, otherwise returns the User's login name.intgetId()The buddy id.getName()The name of this buddy.Returns the nickname of this buddy.Retrieves the list of persistent Buddy Variables of this buddy.Retrieves the list of non-persistent Buddy Variables of this buddy.getState()Returns the custom state of this buddy.getVariable(String varName) Retrieves a Buddy Variable from its name.Returns a list of BuddyVariable objects associated with the buddy.inthashCode()booleanIndicates whether this buddy is blocked in the current user's buddies list or not.booleanisOnline()Indicates whether this buddy is online in the Buddy List system or not.booleanisTemp()Indicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not.voidremoveVariable(String varName) voidsetBlocked(boolean blocked) voidsetId(int id) voidsetVariable(BuddyVariable bVar) voidsetVariables(List<BuddyVariable> variables) toString()Returns a string that contains the buddy name and id.
-
Field Details
-
name
-
id
protected int id -
isBlocked
protected boolean isBlocked -
variables
-
isTemp
protected boolean isTemp
-
-
Constructor Details
-
SFSBuddy
Creates a new SFSBuddy instance.NOTE: never instantiate a SFSBuddy manually: this is done by the SmartFoxServer 3 API internally.
-
SFSBuddy
-
SFSBuddy
-
-
Method Details
-
fromSFSArray
- Internal
-
getId
public int getId()Description copied from interface:BuddyThe buddy id. This is equal to the id assigned by SmartFoxServer to the corresponding User. -
getName
Description copied from interface:BuddyThe name of this buddy. This is equal to the login name of the corresponding User. -
getDisplayName
Description copied from interface:BuddyIf a Buddy nickname exists returns that nickname, otherwise returns the User's login name.- Specified by:
getDisplayNamein interfaceBuddy- Returns:
- the nickname (if any), otherwise the User's name.
-
isBlocked
public boolean isBlocked()Description copied from interface:BuddyIndicates 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. -
isOnline
public boolean isOnline()Description copied from interface:BuddyIndicates whether this buddy is online in the Buddy List system or not. -
isTemp
public boolean isTemp()Description copied from interface:BuddyIndicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not. -
getState
Description copied from interface:BuddyReturns the custom state of this buddy. Examples of custom states are "Available", "Busy", "Be right back", etc. If the custom state is not set,nullis returned.The list of available custom states is returned by the IBuddyManager.buddyStates property.
-
getNickName
Description copied from interface:BuddyReturns the nickname of this buddy. If the nickname is not set,nullis returned.- Specified by:
getNickNamein interfaceBuddy
-
getVariables
Description copied from interface:BuddyReturns a list of BuddyVariable objects associated with the buddy.- Specified by:
getVariablesin interfaceBuddy- See Also:
-
getVariable
Description copied from interface:BuddyRetrieves a Buddy Variable from its name.- Specified by:
getVariablein interfaceBuddy- Parameters:
varName- The name of the Buddy Variable to be retrieved.- Returns:
- The BuddyVariable object representing the Buddy Variable, or
nullif no Buddy Variable with the passed name is associated with this buddy. - See Also:
-
containsVariable
Description copied from interface:BuddyIndicates whether this buddy has the specified Buddy Variable set or not.- Specified by:
containsVariablein interfaceBuddy- Parameters:
varName- The name of the Buddy Variable whose existence must be checked.- Returns:
trueif a Buddy Variable with the passed name is set for this buddy.
-
getOfflineVariables
Description copied from interface:BuddyRetrieves the list of persistent Buddy Variables of this buddy.- Specified by:
getOfflineVariablesin interfaceBuddy- Returns:
- A List of BuddyVariable objects.
- See Also:
-
getOnlineVariables
Description copied from interface:BuddyRetrieves the list of non-persistent Buddy Variables of this buddy.- Specified by:
getOnlineVariablesin interfaceBuddy- Returns:
- A List of BuddyVariable objects.
- See Also:
-
setVariable
- Specified by:
setVariablein interfaceBuddy
-
setVariables
- Specified by:
setVariablesin interfaceBuddy- Internal
-
setId
public void setId(int id) -
setBlocked
public void setBlocked(boolean blocked) - Specified by:
setBlockedin interfaceBuddy- Internal
-
removeVariable
- Specified by:
removeVariablein interfaceBuddy- Internal
-
clearVolatileVariables
public void clearVolatileVariables()- Specified by:
clearVolatileVariablesin interfaceBuddy- Internal
-
equals
-
hashCode
public int hashCode() -
toString
Returns a string that contains the buddy name and id.
-