Class SFSUserVariable

java.lang.Object
sfs3.client.entities.variables.BaseVariable
sfs3.client.entities.variables.SFSUserVariable
All Implemented Interfaces:
UserVariable, Variable

public class SFSUserVariable extends BaseVariable implements UserVariable
The SFSUserVariable is a custom value attached to a User object that gets automatically synchronized between clients and the server on every change.

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 Details

    • _isPrivate

      protected boolean _isPrivate
  • Constructor Details

  • Method Details

    • fromSFSArray

      public static UserVariable fromSFSArray(ISFSArray sfsa)
      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:
      isPrivate in interface UserVariable
      Returns:
      whether or not the variable is private
    • setPrivate

      public void setPrivate(boolean value)
      Specified by:
      setPrivate in interface UserVariable
    • toSFSArray

      public ISFSArray toSFSArray()
      Private
      Specified by:
      toSFSArray in interface Variable
      Overrides:
      toSFSArray in class BaseVariable
    • toString

      public String toString()
      Overrides:
      toString in class BaseVariable