Package org.cis1200
Class LeaveCommand
java.lang.Object
org.cis1200.Command
org.cis1200.LeaveCommand
Represents a
Command
issued by a client to leave a channel.-
Constructor Summary
ConstructorsConstructorDescriptionLeaveCommand
(int senderId, String channel) Constructor; initializes the private fields of the object. -
Method Summary
Modifier and TypeMethodDescriptiontoString()
updateServerModel
(ServerModel model) Process the command and update the server model accordingly.Methods inherited from class org.cis1200.Command
equals, getSenderId
-
Constructor Details
-
LeaveCommand
Constructor; initializes the private fields of the object.- Parameters:
senderId
- of this commandchannel
- where the user wants to leave. If the user is the owner of this channel, the channel is destroyed.
-
-
Method Details
-
updateServerModel
Description copied from class:Command
Process the command and update the server model accordingly.- Specified by:
updateServerModel
in classCommand
- Parameters:
model
- An instance of theServerModel
class which represents the current state of the server.- Returns:
- A
ResponseSet
object, informing clients about changes resulting from the command.
-
getChannel
- Returns:
- channel the user wishes to leave
-
toString
-