Enum Class ServerAnnouncement

java.lang.Object
java.lang.Enum<ServerAnnouncement>
it.meucci.utils.ServerAnnouncement
All Implemented Interfaces:
Serializable, Comparable<ServerAnnouncement>, Constable

public enum ServerAnnouncement extends Enum<ServerAnnouncement>
Represents the types of Server Announcement a message of type SERVER_ANN can have. Cfr. Type.
  • Enum Constant Details

    • JOINED

      public static final ServerAnnouncement JOINED
      Sent when a new user joins the server
    • LEFT

      public static final ServerAnnouncement LEFT
      Sent when a user lefts the server
    • NAME_OK

      public static final ServerAnnouncement NAME_OK
      Sent when the user requesting a new username has inserted a valid one.
    • NAME_NOT_OK

      public static final ServerAnnouncement NAME_NOT_OK
      Sent when the user requesting a new username has inserted a not valid one.
    • NEED_NAME

      public static final ServerAnnouncement NEED_NAME
      Sent when the user attempting to send a message doesn't have a valid username set.
    • LIST

      public static final ServerAnnouncement LIST
      Sent when the server sends a list of connected usernames
    • DEST_NOT_CORRECT

      public static final ServerAnnouncement DEST_NOT_CORRECT
      Sent when a message doesn't have a valid addressee
    • DISCONNECT

      public static final ServerAnnouncement DISCONNECT
      Sent as a confirmation to the `DISCONNECT` command CommandType
    • COMMAND_NOT_RECOGNIZED

      public static final ServerAnnouncement COMMAND_NOT_RECOGNIZED
      Sent when the command issued by the user is not valid nor recognized
    • USERNAME_CHANGED

      public static final ServerAnnouncement USERNAME_CHANGED
      Sent when the username of a user successfully changed
  • Method Details

    • values

      public static ServerAnnouncement[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ServerAnnouncement valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null