Class SFSUserVariable
- All Implemented Interfaces:
UserVariable,Variable
User Variables are useful to store custom user data that must be "visible" to the other users, such as a profile, score, status message, etc. User Variables can be set by means of the SetUserVariablesRequest request;
User Variables can be 'private': this flag allows to limit the visibility of variables to their owner only. In other words User Variables marked as private are not synchronized with other users in the Room.
- See Also:
-
Field Summary
FieldsFields inherited from class sfs3.client.entities.variables.BaseVariable
name, type, val -
Constructor Summary
ConstructorsConstructorDescriptionSFSUserVariable(String name, Object val) Creates a new SFSUserVariable instance.SFSUserVariable(String name, Object value, VariableType type) Typically types are auto detected: seeSFSUserVariable(String, Object) -
Method Summary
Modifier and TypeMethodDescriptionstatic UserVariablefromSFSArray(ISFSArray sfsa) booleanIndicates whether this User Variable is private or not.voidsetPrivate(boolean value) PrivatetoString()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, setValueMethods 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
-
Field Details
-
_isPrivate
protected boolean _isPrivate
-
-
Constructor Details
-
SFSUserVariable
Creates a new SFSUserVariable instance.- See Also:
-
SFSUserVariable
Typically types are auto detected: seeSFSUserVariable(String, Object)- Parameters:
name- The name of the User Variable.value- The value of the User Variable;type- The type of the User Variable- See Also:
-
-
Method Details
-
fromSFSArray
- Internal
-
isPrivate
public boolean isPrivate()Indicates whether this User Variable is private or not.A private User Variable is visible only to its owner; any changes made to the variable will be transmitted to the owner only.
NOTE: setting the private property manually on an existing User Variable returned by the API has no effect on the server and can disrupt the API functioning. This flag can be set when the User Variable object is created by the developer only (using the new keyword).
- Specified by:
isPrivatein interfaceUserVariable- Returns:
- whether or not the variable is private
-
setPrivate
public void setPrivate(boolean value) - Specified by:
setPrivatein interfaceUserVariable
-
toSFSArray
Private- Specified by:
toSFSArrayin interfaceVariable- Overrides:
toSFSArrayin classBaseVariable
-
toString
- Overrides:
toStringin classBaseVariable
-