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, setValueFromStringLiteral
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isHidden, isStorable, setHidden, setNull, setStorable
getBoolValue, getDoubleValue, getIntValue, getName, getSFSArrayValue, getSFSObjectValue, getStringValue, getType, getValue, isNull
protected 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 RoomVariable
RoomVariable.setGlobal(boolean)
public boolean isPersistent()
isPersistent
in interface RoomVariable
RoomVariable.setPersistent(boolean)
public boolean isPrivate()
isPrivate
in interface UserVariable
isPrivate
in class SFSUserVariable
setPrivate(boolean)
public void setGlobal(boolean flag)
setGlobal
in interface RoomVariable
public void setPersistent(boolean flag)
setPersistent
in interface RoomVariable
public void setPrivate(boolean flag)
setPrivate
in interface UserVariable
setPrivate
in class SFSUserVariable
flag
- public User getOwner()
getOwner
in interface RoomVariable
public void setOwner(User user)
setOwner
in interface RoomVariable
public java.lang.String getOwnerAsString()
public ISFSArray toSFSArray()
Variable
toSFSArray
in interface Variable
toSFSArray
in class SFSUserVariable
public java.lang.String toString()
toString
in class SFSUserVariable