Class SFSBuddyVariable
- All Implemented Interfaces:
BuddyVariable,Variable
Buddy Variables work with the same principle of the User and Room Variables. The only difference is the logic by which they get propagated to other users. While Room and User Variables are usually sent to all clients in the same Room, Buddy Variables are sent to users who have the owner (of the Buddy Variable) in their Buddy Lists.
There is a special convention that allows Buddy Variables to be set as "offline".
Offline Buddy Variables are persistent values which are made available to all users who have the owner in their Buddy Lists,
whether that Buddy is online or not.
In order to make a Buddy Variable persistent, its name should start with a dollar sign, for example: $avatarPic.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe prefix to be added to a Buddy Variable name to make it persistent.Fields inherited from class sfs3.client.entities.variables.BaseVariable
name, type, val -
Constructor Summary
ConstructorsConstructorDescriptionSFSBuddyVariable(String name, Object val) Creates a new Buddy VariableSFSBuddyVariable(String name, Object value, VariableType type) Types are normally auto-detected. -
Method Summary
Modifier and TypeMethodDescriptionstatic BuddyVariablefromSFSArray(ISFSArray sfsa) booleanIndicates whether the Buddy Variable is persistent or not.toString()Returns a string that contains the Buddy Variable name, type and value.Methods inherited from class sfs3.client.entities.variables.BaseVariable
getBoolValue, getByteValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getName, getSFSArrayValue, getSFSObjectValue, getSFSVector2Value, getSFSVector3Value, getShortValue, getStringValue, getType, getValue, isNull, populateArrayWithValue, setValue, toSFSArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface sfs3.client.entities.variables.Variable
getBoolValue, getByteValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getName, getSFSArrayValue, getSFSObjectValue, getSFSVector2Value, getSFSVector3Value, getShortValue, getStringValue, getType, getValue, isNull, toSFSArray
-
Field Details
-
OFFLINE_PREFIX
The prefix to be added to a Buddy Variable name to make it persistent. A persistent Buddy Variable is made available to all users who have the owner in their Buddy Lists, whether that Buddy is online or not.- See Also:
-
-
Constructor Details
-
SFSBuddyVariable
Creates a new Buddy Variable -
SFSBuddyVariable
Types are normally auto-detected. Please see:SFSBuddyVariable(String, Object)- Parameters:
name- name of the Buddy Variablevalue- value of the Buddy Variabletype- type of the Buddy Variable- See Also:
-
-
Method Details
-
fromSFSArray
- Internal
-
isOffline
public boolean isOffline()Description copied from interface:BuddyVariableIndicates whether the Buddy Variable is persistent or not.By convention any Buddy Variable whose name starts with the dollar sign (
$) will be regarded as persistent and stored locally by the server. Persistent Buddy Variables are also referred to as "offline variables" because they are available to all users who have the owner in their Buddy Lists, whether that Buddy is online or not.- Specified by:
isOfflinein interfaceBuddyVariable
-
toString
Returns a string that contains the Buddy Variable name, type and value.- Overrides:
toStringin classBaseVariable- Returns:
- The string representation of the SFSBuddyVariable object.
-