public class SFSRoomVariable extends SFSUserVariable implements RoomVariable
RoomVariables support basic data types and nested complex objects:
RoomVariables also support different flags:
| Modifier | Constructor and Description |
|---|---|
protected |
SFSRoomVariable(java.lang.String name) |
|
SFSRoomVariable(java.lang.String name,
java.lang.Object value)
Create a new Room Variable
|
|
SFSRoomVariable(java.lang.String name,
java.lang.Object value,
boolean isPrivate,
boolean isPersistent,
boolean isGlobal)
Create a new Room Variable
|
protected |
SFSRoomVariable(java.lang.String name,
java.lang.String type,
java.lang.String literal) |
| Modifier and Type | Method and Description |
|---|---|
User |
getOwner()
Return the User that created the variable.
|
java.lang.String |
getOwnerAsString() |
boolean |
isGlobal()
Checks if a RoomVariable is global
|
boolean |
isPersistent()
Checks if a RoomVariable is persistent
|
boolean |
isPrivate()
Checks if a RoomVariable is private.
|
static SFSRoomVariable |
newFromSFSArray(ISFSArray array) |
static SFSRoomVariable |
newFromStringLiteral(java.lang.String name,
java.lang.String type,
java.lang.String literal) |
void |
setGlobal(boolean flag)
When a RoomVariable is set to global all changes will be broadcast not only to the Users in the Room
but also to all other Users in the same Room Group
|
void |
setOwner(User user)
Sets the creator of a variable.
|
void |
setPersistent(boolean flag)
When a RoomVariable is set to persistent the variable will not be removed from a Room when the user
leaves it.
|
void |
setPrivate(boolean flag)
When a RoomVariable is set to private only its owner can modify or delete it.
|
ISFSArray |
toSFSArray()
Private
|
java.lang.String |
toString() |
clone, getBoolValue, getDoubleValue, getIntValue, getName, getSFSArrayValue, getSFSObjectValue, getStringValue, getType, getValue, isHidden, isNull, isStorable, newInstance, newPrivateVariable, populateArrayWithValue, setHidden, setNull, setStorable, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFromStringLiteralequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisHidden, isStorable, setHidden, setNull, setStorablegetBoolValue, getDoubleValue, getIntValue, getName, getSFSArrayValue, getSFSObjectValue, getStringValue, getType, getValue, isNullprotected SFSRoomVariable(java.lang.String name)
protected SFSRoomVariable(java.lang.String name,
java.lang.String type,
java.lang.String literal)
public SFSRoomVariable(java.lang.String name,
java.lang.Object value)
name - the variable namevalue - the variable value (see supported data types at the top)public SFSRoomVariable(java.lang.String name,
java.lang.Object value,
boolean isPrivate,
boolean isPersistent,
boolean isGlobal)
name - the variable namevalue - the variable value (see supported data types at the top)isPrivate - the private flagisPersistent - the persistent flagisGlobal - the global flagpublic static SFSRoomVariable newFromStringLiteral(java.lang.String name, java.lang.String type, java.lang.String literal)
public static SFSRoomVariable newFromSFSArray(ISFSArray array)
public boolean isGlobal()
isGlobal in interface RoomVariableRoomVariable.setGlobal(boolean)public boolean isPersistent()
isPersistent in interface RoomVariableRoomVariable.setPersistent(boolean)public boolean isPrivate()
isPrivate in interface UserVariableisPrivate in class SFSUserVariablesetPrivate(boolean)public void setGlobal(boolean flag)
setGlobal in interface RoomVariablepublic void setPersistent(boolean flag)
setPersistent in interface RoomVariablepublic void setPrivate(boolean flag)
setPrivate in interface UserVariablesetPrivate in class SFSUserVariableflag - public User getOwner()
getOwner in interface RoomVariablepublic void setOwner(User user)
setOwner in interface RoomVariablepublic java.lang.String getOwnerAsString()
public ISFSArray toSFSArray()
VariabletoSFSArray in interface VariabletoSFSArray in class SFSUserVariablepublic java.lang.String toString()
toString in class SFSUserVariable