Package | com.smartfoxserver.v2.entities |
Class | public class SFSBuddy |
Inheritance | SFSBuddy Object |
Implements | Buddy |
A buddy is marked out by the following characteristics.
See also
Property | Defined By | ||
---|---|---|---|
id : int [read-only]
Indicates the id of this buddy. | SFSBuddy | ||
isBlocked : Boolean [read-only]
Indicates whether this buddy is blocked in the current user's buddies list or not. | SFSBuddy | ||
isOnline : Boolean [read-only]
Indicates whether this buddy is online in the Buddy List system or not. | SFSBuddy | ||
isTemp : Boolean [read-only]
Indicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not. | SFSBuddy | ||
name : String [read-only]
Indicates the name of this buddy. | SFSBuddy | ||
nickName : String [read-only]
Returns the nickname of this buddy. | SFSBuddy | ||
state : String [read-only]
Returns the custom state of this buddy. | SFSBuddy | ||
variables : Array [read-only]
Returns a list of BuddyVariable objects associated with the buddy. | SFSBuddy |
Method | Defined By | ||
---|---|---|---|
SFSBuddy(id:int, name:String, isBlocked:Boolean = false, isTemp:Boolean = false)
Creates a new SFSBuddy instance. | SFSBuddy | ||
containsVariable(varName:String):Boolean
Indicates whether this buddy has the specified Buddy Variable set or not. | SFSBuddy | ||
getOfflineVariables():Array
Retrieves the list of persistent Buddy Variables of this buddy. | SFSBuddy | ||
getOnlineVariables():Array
Retrieves the list of non-persistent Buddy Variables of this buddy. | SFSBuddy | ||
getVariable(varName:String):BuddyVariable
Retrieves a Buddy Variable from its name. | SFSBuddy | ||
toString():String
Returns a string that contains the buddy name and id. | SFSBuddy |
id | property |
id:int
[read-only] Indicates the id of this buddy. This is equal to the id assigned by SmartFoxServer to the corresponding user.
public function get id():int
isBlocked | property |
isBlocked:Boolean
[read-only] 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.
public function get isBlocked():Boolean
isOnline | property |
isOnline:Boolean
[read-only] Indicates whether this buddy is online in the Buddy List system or not.
public function get isOnline():Boolean
isTemp | property |
isTemp:Boolean
[read-only] Indicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not.
public function get isTemp():Boolean
name | property |
name:String
[read-only] Indicates the name of this buddy. This is equal to the name of the corresponding user.
public function get name():String
nickName | property |
nickName:String
[read-only]
Returns the nickname of this buddy.
If the nickname is not set, null
is returned.
public function get nickName():String
state | property |
state:String
[read-only]
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.
public function get state():String
variables | property |
variables:Array
[read-only] Returns a list of BuddyVariable objects associated with the buddy.
public function get variables():Array
SFSBuddy | () | Constructor |
public function SFSBuddy(id:int, name:String, isBlocked:Boolean = false, isTemp:Boolean = false)
Creates a new SFSBuddy instance.
NOTE: developers never istantiate a SFSBuddy manually: this is done by the SmartFoxServer 2X API internally.
Parametersid:int — The buddy id.
| |
name:String — The buddy name.
| |
isBlocked:Boolean (default = false ) — If true , the buddy being created is blocked by the current user.
| |
isTemp:Boolean (default = false ) — If true , the buddy being created is temporary in the current client.
|
containsVariable | () | method |
public function containsVariable(varName:String):Boolean
Indicates whether this buddy has the specified Buddy Variable set or not.
Parameters
varName:String — The name of the Buddy Variable whose existance must be checked.
|
Boolean — true if a Buddy Variable with the passed name is set for this buddy.
|
getOfflineVariables | () | method |
public function getOfflineVariables():Array
Retrieves the list of persistent Buddy Variables of this buddy.
ReturnsArray — An array of BuddyVariable objects.
|
getOnlineVariables | () | method |
public function getOnlineVariables():Array
Retrieves the list of non-persistent Buddy Variables of this buddy.
ReturnsArray — An array of BuddyVariable objects.
|
getVariable | () | method |
public function getVariable(varName:String):BuddyVariable
Retrieves a Buddy Variable from its name.
Parameters
varName:String — The name of the Buddy Variable to be retrieved.
|
BuddyVariable — The BuddyVariable object representing the Buddy Variable, or null if no Buddy Variable with the passed name is associated with this buddy.
|
toString | () | method |
public function toString():String
Returns a string that contains the buddy name and id.
ReturnsString — The string representation of the SFSBuddy object.
|