Class SFSInvitation

  • All Implemented Interfaces:
    Invitation

    public class SFSInvitation
    extends java.lang.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:
    InviteUsersRequest, InvitationReplyRequest, SFSEvent.INVITATION
    • Constructor Summary

      Constructors 
      Constructor Description
      SFSInvitation​(User inviter, User invitee)  
      SFSInvitation​(User inviter, User invitee, int secondsForAnswer)  
      SFSInvitation​(User inviter, User invitee, int secondsForAnswer, com.smartfoxserver.v2.entities.data.ISFSObject parameters)
      Creates a new SFSInvitation instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getId()
      Indicates the id of this invitation.
      User getInvitee()
      Returns the User object corresponding to the user who received the invitation.
      User getInviter()
      Returns the User object corresponding to the user who sent the invitation.
      com.smartfoxserver.v2.entities.data.ISFSObject getParams()
      Returns an instance of SFSObject containing a custom set of parameters.
      int getSecondsForAnswer()
      Returns the number of seconds available to the invitee to reply to the invitation, after which the invitation expires.
      void setId​(int id)
      * API internal usage only *
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SFSInvitation

        public SFSInvitation​(User inviter,
                             User invitee,
                             int secondsForAnswer,
                             com.smartfoxserver.v2.entities.data.ISFSObject parameters)
        Creates a new SFSInvitation instance.

        NOTE: developers never instantiate an SFSInvitation manually: this is done by the SmartFoxServer 2X 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:
        SFSEvent.INVITATION, User, SFSObject
      • SFSInvitation

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

        public SFSInvitation​(User inviter,
                             User invitee)
    • Method Detail

      • 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)
        * API internal usage only *
        Specified by:
        setId in interface Invitation
      • 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 com.smartfoxserver.v2.entities.data.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object