Package sfs2x.client.entities.invitation
Class SFSInvitation
- java.lang.Object
-
- sfs2x.client.entities.invitation.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.
-
-
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()
-
-
-
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
-
-
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 interfaceInvitation
-
setId
public void setId(int id)
* API internal usage only *- Specified by:
setId
in interfaceInvitation
-
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 interfaceInvitation
-
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 interfaceInvitation
-
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 interfaceInvitation
-
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 interfaceInvitation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-