sjrd.tricktakinggame.network
Enum ResponseCode

java.lang.Object
  extended by java.lang.Enum<ResponseCode>
      extended by sjrd.tricktakinggame.network.ResponseCode
All Implemented Interfaces:
Serializable, Comparable<ResponseCode>

public enum ResponseCode
extends Enum<ResponseCode>

Code de réponse (de succès ou d'erreur)

Author:
sjrd

Enum Constant Summary
AdminConnectionOK
           
BadPlayerCount
           
CardGameFatalError
           
FirstConnectionOK
           
Forbidden
           
InvalidAdmin
           
InvalidLogin
           
InvalidResponseLine
           
InvalidSessionCode
           
LoggerConnectionOK
           
OK
           
Pong
           
Protocol
           
SecondConnectionOK
           
StatusAuctioning
           
StatusNoTable
           
StatusNotPlaying
           
StatusPlaying
           
StatusWaitingForPlayers
           
TableIsFull
           
UnknownError
           
UnknownRulesProviderID
           
UserAlreadyLogged
           
 
Field Summary
private  int code
          Code numérique
private  String defaultMessage
          Message par défaut
private  boolean protocol
          Indique si le code de réponse est une erreur de protocole
private  boolean successful
          Indique si le code de réponse est un code de succès
 
Method Summary
static ResponseCode findByCode(int code)
          Identifie un code d'erreur d'après son code numérie
 int getCode()
          Code numérie
 String getDefaultMessage()
          Message par défaut
 boolean isProtocol()
          Indique si le code de réponse est une erreur de protocole
 boolean isSuccessful()
          Indique si le code de réponse est un code de succès
static ResponseCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ResponseCode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UnknownError

public static final ResponseCode UnknownError

CardGameFatalError

public static final ResponseCode CardGameFatalError

Pong

public static final ResponseCode Pong

OK

public static final ResponseCode OK

FirstConnectionOK

public static final ResponseCode FirstConnectionOK

SecondConnectionOK

public static final ResponseCode SecondConnectionOK

AdminConnectionOK

public static final ResponseCode AdminConnectionOK

LoggerConnectionOK

public static final ResponseCode LoggerConnectionOK

StatusNoTable

public static final ResponseCode StatusNoTable

StatusWaitingForPlayers

public static final ResponseCode StatusWaitingForPlayers

StatusNotPlaying

public static final ResponseCode StatusNotPlaying

StatusAuctioning

public static final ResponseCode StatusAuctioning

StatusPlaying

public static final ResponseCode StatusPlaying

Forbidden

public static final ResponseCode Forbidden

UnknownRulesProviderID

public static final ResponseCode UnknownRulesProviderID

BadPlayerCount

public static final ResponseCode BadPlayerCount

TableIsFull

public static final ResponseCode TableIsFull

Protocol

public static final ResponseCode Protocol

InvalidResponseLine

public static final ResponseCode InvalidResponseLine

InvalidLogin

public static final ResponseCode InvalidLogin

InvalidSessionCode

public static final ResponseCode InvalidSessionCode

UserAlreadyLogged

public static final ResponseCode UserAlreadyLogged

InvalidAdmin

public static final ResponseCode InvalidAdmin
Field Detail

code

private int code
Code numérique


defaultMessage

private String defaultMessage
Message par défaut


successful

private boolean successful
Indique si le code de réponse est un code de succès


protocol

private boolean protocol
Indique si le code de réponse est une erreur de protocole

Method Detail

values

public static ResponseCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ResponseCode c : ResponseCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ResponseCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
NullPointerException - if the argument is null

getCode

public int getCode()
Code numérie

Returns:
Code numérique

getDefaultMessage

public String getDefaultMessage()
Message par défaut

Returns:
Message par défaut

isSuccessful

public boolean isSuccessful()
Indique si le code de réponse est un code de succès

Returns:
true pour un code de succès, false pour un code d'erreur

isProtocol

public boolean isProtocol()
Indique si le code de réponse est une erreur de protocole

Returns:
true pour une erreur de protocole, false sinon

findByCode

public static ResponseCode findByCode(int code)
Identifie un code d'erreur d'après son code numérie

Parameters:
code - Code numérique de l'erreur
Returns:
Code d'erreur correspondant, ou Protocol si non trouvé