Interface RoomVariable
-
- All Superinterfaces:
java.lang.Cloneable,UserVariable,Variable
- All Known Implementing Classes:
SFSRoomVariable
public interface RoomVariable extends UserVariable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UsergetOwner()Return the User that created the variable.booleanisGlobal()Checks if a RoomVariable is globalbooleanisPersistent()Checks if a RoomVariable is persistentvoidsetGlobal(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 GroupvoidsetOwner(User user)Sets the creator of a variable.voidsetPersistent(boolean flag)When a RoomVariable is set to persistent the variable will not be removed from a Room when the user leaves it.-
Methods inherited from interface com.smartfoxserver.v2.entities.variables.UserVariable
isHidden, isPrivate, isStorable, setHidden, setNull, setPrivate, setStorable
-
Methods inherited from interface com.smartfoxserver.v2.entities.variables.Variable
getBoolValue, getDoubleValue, getIntValue, getName, getSFSArrayValue, getSFSObjectValue, getStringValue, getType, getValue, isNull, toSFSArray
-
-
-
-
Method Detail
-
isPersistent
boolean isPersistent()
Checks if a RoomVariable is persistent- Returns:
- true if the variable is persistent
- See Also:
setPersistent(boolean)
-
isGlobal
boolean isGlobal()
Checks if a RoomVariable is global- Returns:
- true if the variable is global
- See Also:
setGlobal(boolean)
-
setPersistent
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. RoomVariables created by a certain User are removed when the User disconnects- Parameters:
flag-
-
setGlobal
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- Parameters:
flag-
-
getOwner
User getOwner()
Return the User that created the variable. Null is returned if the variable is owned by the Server- Returns:
- the variable owner
-
setOwner
void setOwner(User user)
Sets the creator of a variable. Null can be used to set the Server as the owner. When a variable is owned by the Server it will never be removed.- Parameters:
user-
-
-