Package sfs3.client.entities
Interface Buddy
- All Known Implementing Classes:
SFSBuddy
public interface Buddy
In the SmartFoxServer 3 client API this interface is implemented by the SFSBuddy class.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancontainsVariable(String varName) Indicates whether this buddy has the specified Buddy Variable set or not.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.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)
-
Method Details
-
getId
int getId()The buddy id. This is equal to the id assigned by SmartFoxServer to the corresponding User.- See Also:
-
getName
String getName()The name of this buddy. This is equal to the login name of the corresponding User.- See Also:
-
getDisplayName
String getDisplayName()If a Buddy nickname exists returns that nickname, otherwise returns the User's login name.- Returns:
- the nickname (if any), otherwise the User's name.
-
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:
-
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
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,nullis returned.The list of available custom states is returned by the IBuddyManager.buddyStates property.
- See Also:
-
getNickName
String getNickName()Returns the nickname of this buddy. If the nickname is not set,nullis returned. -
getVariables
List<BuddyVariable> getVariables()Returns a list of BuddyVariable objects associated with the buddy.- See Also:
-
getVariable
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
nullif no Buddy Variable with the passed name is associated with this buddy. - See Also:
-
containsVariable
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:
trueif a Buddy Variable with the passed name is set for this buddy.
-
getOfflineVariables
List<BuddyVariable> getOfflineVariables()Retrieves the list of persistent Buddy Variables of this buddy.- Returns:
- A List of BuddyVariable objects.
- See Also:
-
getOnlineVariables
List<BuddyVariable> getOnlineVariables()Retrieves the list of non-persistent Buddy Variables of this buddy.- Returns:
- A List of BuddyVariable objects.
- See Also:
-
setVariable
- Internal
-
setVariables
- Internal
-
setId
void setId(int id) - Internal
-
setBlocked
void setBlocked(boolean blocked) - Internal
-
removeVariable
- Internal
-
clearVolatileVariables
void clearVolatileVariables()- Internal
-