Class SFSInvitation

java.lang.Object
sfs3.client.entities.invitation.SFSInvitation
All Implemented Interfaces:
Invitation

public class SFSInvitation extends Object implements Invitation
The SFSInvitation object contains all the informations about an invitation received by the current user.

An invitation is sent through the InviteUsersRequest request and it is received as an invitation event. Clients can reply to an invitation using the InvitationReplyRequest request.

See Also:
  • Field Details

    • id

      protected int id
    • inviter

      protected User inviter
    • invitee

      protected User invitee
    • secondsForAnswer

      protected int secondsForAnswer
    • parameters

      protected ISFSObject parameters
  • Constructor Details

    • SFSInvitation

      public SFSInvitation(User inviter, User invitee, int secondsForAnswer, ISFSObject parameters)
      Creates a new SFSInvitation instance.

      NOTE: developers never instantiate an SFSInvitation manually: this is done by the SmartFoxServer 3 API internally. A reference to an existing instance is always provided by the invitation event.

      Parameters:
      inviter - A User object corresponding to the user who sent the invitation.
      invitee - A User object corresponding to the user who received the invitation.
      secondsForAnswer - The number of seconds available to the invitee to reply to the invitation.
      parameters - An instance of SFSObject containing a custom set of parameters representing the invitation details.
      See Also:
    • SFSInvitation

      public SFSInvitation(User inviter, User invitee, int secondsForAnswer)
    • SFSInvitation

      public SFSInvitation(User inviter, User invitee)
  • Method Details

    • getId

      public int getId()
      Description copied from interface: Invitation
      Indicates the id of this invitation. It is generated by the server when the invitation is sent.

      NOTE: setting the id property manually has no effect on the server and can disrupt the API functioning.

      Specified by:
      getId in interface Invitation
    • setId

      public void setId(int id)
      Specified by:
      setId in interface Invitation
      Internal
    • getInviter

      public User getInviter()
      Description copied from interface: Invitation
      Returns the User object corresponding to the user who sent the invitation.
      Specified by:
      getInviter in interface Invitation
    • getInvitee

      public User getInvitee()
      Description copied from interface: Invitation
      Returns the User object corresponding to the user who received the invitation.
      Specified by:
      getInvitee in interface Invitation
    • getSecondsForAnswer

      public int getSecondsForAnswer()
      Description copied from interface: Invitation
      Returns the number of seconds available to the invitee to reply to the invitation, after which the invitation expires.
      Specified by:
      getSecondsForAnswer in interface Invitation
    • getParams

      public ISFSObject getParams()
      Description copied from interface: Invitation
      Returns an instance of SFSObject containing a custom set of parameters. It usually stores invitation details, like a message to the invitee and any other relevant data.
      Specified by:
      getParams in interface Invitation
    • toString

      public String toString()
      Overrides:
      toString in class Object