public class SFSBuddy extends java.lang.Object implements Buddy
Any user can decide if they want to be online/off-line as Buddy in the Buddy system. By default a User is online every time he joins the Zone, but the User can also turn off this flag at runtime and disappear from other User's buddy lists. The Online State is persistent and based on a reserved Buddy Variable.
BuddyListManager,
ReservedBuddyVariables,
BuddyStorage,
SFSEvent| Constructor and Description |
|---|
SFSBuddy(java.lang.String name) |
SFSBuddy(java.lang.String name,
boolean isTemp) |
| Modifier and Type | Method and Description |
|---|---|
ISFSArray |
getBuddyVariablesData() |
java.lang.String |
getName()
The Buddy name, which corresponds to the User name.
|
java.lang.String |
getNickName()
Get the nickname of the Buddy.
|
BuddyList |
getParentBuddyList()
Return the parent BuddyList containing this Buddy
|
java.lang.String |
getState()
Returns the current Buddy State
|
BuddyVariable |
getVariable(java.lang.String varName)
Get a Buddy Variable from its name
|
java.util.List<BuddyVariable> |
getVariables()
Get all BuddyVariables
|
boolean |
hasVariables()
Checks if the Buddy has at least one variable set
|
boolean |
isBlocked()
When a Buddy is blocked he won't be able to see the User status and send him messages
|
boolean |
isOnline()
Checks if the Buddy is active in the system
|
boolean |
isTemp()
A temporary Buddy will only exist at runtime but will be lost as soon as he goes away
or the user is disconnected.
|
void |
setBlocked(boolean value)
Block the Buddy
|
void |
setIsTemp(boolean value) |
void |
setParentBuddyList(BuddyList parentList)
Set the parent BuddyList
|
void |
setVariable(BuddyVariable buddyVariable)
Set / modify a BuddyVariable.
|
void |
setVariables(java.util.List<BuddyVariable> buddyVariables)
Sets a number of variables at once.
|
ISFSArray |
toSFSArray() |
java.lang.String |
toString() |
public SFSBuddy(java.lang.String name)
public SFSBuddy(java.lang.String name,
boolean isTemp)
public java.lang.String getName()
Buddypublic BuddyList getParentBuddyList()
BuddygetParentBuddyList in interface Buddypublic void setParentBuddyList(BuddyList parentList)
BuddysetParentBuddyList in interface BuddyparentList - the BuddyListpublic java.lang.String getState()
Buddypublic java.lang.String getNickName()
BuddygetNickName in interface Buddypublic boolean hasVariables()
BuddyhasVariables in interface Buddypublic BuddyVariable getVariable(java.lang.String varName)
BuddygetVariable in interface BuddyvarName - the variable namepublic java.util.List<BuddyVariable> getVariables()
BuddygetVariables in interface Buddypublic boolean isBlocked()
Buddypublic boolean isOnline()
Buddypublic boolean isTemp()
Buddypublic void setBlocked(boolean value)
BuddysetBlocked in interface Buddyvalue - true to block the buddy, false to unblock himpublic void setVariable(BuddyVariable buddyVariable)
BuddysetVariable in interface BuddybuddyVariable - the Buddy Variablepublic void setVariables(java.util.List<BuddyVariable> buddyVariables)
BuddysetVariables in interface BuddybuddyVariables - a list of variablespublic ISFSArray toSFSArray()
toSFSArray in interface Buddypublic ISFSArray getBuddyVariablesData()
getBuddyVariablesData in interface Buddypublic java.lang.String toString()
toString in class java.lang.Object