Package org.cis1200

Class InviteCommand

java.lang.Object
org.cis1200.Command
org.cis1200.InviteCommand

class InviteCommand extends Command
Represents a Command issued by a client to add another client to an invite-only channel owned by the sender.
  • Constructor Details

    • InviteCommand

      public InviteCommand(int senderId, String channel, String userToInvite)
      Constructor; initializes the private fields of the object.
      Parameters:
      senderId - of this command, must be the channel owner
      channel - where the user wants to invite a new user to
      userToInvite - must not be a member of the channel
  • Method Details

    • updateServerModel

      public ResponseSet updateServerModel(ServerModel model)
      Description copied from class: Command
      Process the command and update the server model accordingly.
      Specified by:
      updateServerModel in class Command
      Parameters:
      model - An instance of the ServerModel class which represents the current state of the server.
      Returns:
      A ResponseSet object, informing clients about changes resulting from the command.
    • getChannel

      public String getChannel()
      Returns:
      channel name for the invitation
    • getUserToInvite

      public String getUserToInvite()
      Returns:
      the nickname of the new user to invite
    • toString

      public String toString()
      Overrides:
      toString in class Object