Package org.cis1200

Class CreateCommand

java.lang.Object
org.cis1200.Command
org.cis1200.CreateCommand

class CreateCommand extends Command
Represents a Command issued by a client to create a new channel.
  • Constructor Details

    • CreateCommand

      public CreateCommand(int senderId, String channel, boolean inviteOnly)
      Constructor; initializes the private fields of the object.
      Parameters:
      senderId - of this command
      channel - name of the new channel to create
      inviteOnly - true if this should be a private channel (Task 5)
  • 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:
      the new channel name
    • isInviteOnly

      public boolean isInviteOnly()
      Returns:
      whether this is a private channel
    • toString

      public String toString()
      Overrides:
      toString in class Object