Package it.fi.meucci.utils
Class Username
java.lang.Object
it.fi.meucci.utils.Username
The class representing a user's username.
It is used to address Messages to their recipients.
In the server, each username is associated with a Socket.
It has two static methods that return an object with username "server" and one with username "everyone".
These two usernames are forbidden and the server cannot assign them.
Intuitively, 'server' is the username used to address a message to the server;
'everyone' sends the message in broadcast.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
everyone
As explained above, `everyone` addresses every user connected to the chat.- See Also:
-
server
`server` addresses the server, and it is used in SERVER_ANN and COMMAND messages.- See Also:
-
-
Constructor Details
-
Username
public Username()
-