|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsfs2x.client.entities.SFSBuddy
public class SFSBuddy
The SFSBuddy object represents a buddy in the current user's buddies list.
A buddy is marked out by the following characteristics.
SmartFox.buddyManager,
BuddyVariable| Constructor Summary | |
|---|---|
SFSBuddy(int id,
java.lang.String name)
|
|
SFSBuddy(int id,
java.lang.String name,
boolean isBlocked)
|
|
SFSBuddy(int id,
java.lang.String name,
boolean isBlocked,
boolean isTemp)
Creates a new SFSBuddy instance. |
|
| Method Summary | |
|---|---|
void |
clearVolatileVariables()
*Private* |
boolean |
containsVariable(java.lang.String varName)
Indicates whether this buddy has the specified Buddy Variable set or not. |
static Buddy |
fromSFSArray(com.smartfoxserver.v2.entities.data.ISFSArray arr)
|
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 temporary (non-persistent) in the current user's buddies list or not. |
boolean |
isTemp()
Return true if the Buddy is temporary (not persistent) |
void |
removeVariable(java.lang.String varName)
*Private* |
void |
setBlocked(boolean blocked)
*Private* |
void |
setId(int id)
*Private* |
void |
setVariable(BuddyVariable bVar)
*Private* |
void |
setVariables(java.util.List<BuddyVariable> variables)
*Private* |
java.lang.String |
toString()
Returns a string that contains the buddy name and id. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SFSBuddy(int id,
java.lang.String name,
boolean isBlocked,
boolean isTemp)
NOTE: developers never instantiate a SFSBuddy manually: this is done by the SmartFoxServer 2X API internally.
id - The buddy id.name - The buddy name.isBlocked - If true, the buddy being created is blocked by the current user.isTemp - If true, the buddy being created is temporary in the current client.
public SFSBuddy(int id,
java.lang.String name,
boolean isBlocked)
public SFSBuddy(int id,
java.lang.String name)
| Method Detail |
|---|
public static Buddy fromSFSArray(com.smartfoxserver.v2.entities.data.ISFSArray arr)
public int getId()
Buddy
getId in interface BuddyUser.getId()public java.lang.String getName()
Buddy
getName in interface BuddyUser.getName()public boolean isBlocked()
Buddy
isBlocked in interface BuddyBlockBuddyRequestpublic boolean isOnline()
Buddy
isOnline in interface Buddypublic boolean isTemp()
Buddy
isTemp in interface Buddypublic java.lang.String getState()
Buddynull is returned.
The list of available custom states is returned by the IBuddyManager.buddyStates property.
getState in interface BuddyIBuddyManager.getBuddyStates()public java.lang.String getNickName()
Buddynull is returned.
getNickName in interface Buddypublic java.util.List<BuddyVariable> getVariables()
Buddy
getVariables in interface BuddyBuddyVariable,
Buddy.getVariable(String)public BuddyVariable getVariable(java.lang.String varName)
Buddy
getVariable in interface BuddyvarName - The name of the Buddy Variable to be retrieved.
null if no Buddy Variable with the passed name is associated with this buddy.Buddy.getVariables(),
SetBuddyVariablesRequestpublic boolean containsVariable(java.lang.String varName)
Buddy
containsVariable in interface BuddyvarName - The name of the Buddy Variable whose existance must be checked.
true if a Buddy Variable with the passed name is set for this buddy.public java.util.List<BuddyVariable> getOfflineVariables()
Buddy
getOfflineVariables in interface BuddyBuddyVariable.isOfflinepublic java.util.List<BuddyVariable> getOnlineVariables()
Buddy
getOnlineVariables in interface BuddyBuddyVariable.isOfflinepublic void setVariable(BuddyVariable bVar)
Buddy
setVariable in interface Buddypublic void setVariables(java.util.List<BuddyVariable> variables)
setVariables in interface Buddypublic void setId(int id)
Buddy
setId in interface Buddypublic void setBlocked(boolean blocked)
setBlocked in interface Buddypublic void removeVariable(java.lang.String varName)
removeVariable in interface Buddypublic void clearVolatileVariables()
clearVolatileVariables in interface Buddypublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||