Package org.cis1200

Class NicknameCommand

java.lang.Object
org.cis1200.Command
org.cis1200.NicknameCommand

class NicknameCommand extends Command
Represents a Command issued by a client to change his or her nickname.
  • Constructor Details

    • NicknameCommand

      public NicknameCommand(int senderId, String sender, String newNickname)
  • Method Details

    • updateServerModel

      public Broadcast 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 Broadcast object, informing clients about changes resulting from the command.
    • getNewNickname

      public String getNewNickname()
    • toString

      public String toString()
      Overrides:
      toString in class Object