org.stefaniuk.json.service
Enum JsonServiceError

java.lang.Object
  extended by java.lang.Enum<JsonServiceError>
      extended by org.stefaniuk.json.service.JsonServiceError
All Implemented Interfaces:
Serializable, Comparable<JsonServiceError>

public enum JsonServiceError
extends Enum<JsonServiceError>

JSON service error.

This class provides definition of JSON-RPC error codes.

Since:
2010/09/20
Version:
1.0.0
Author:
Daniel Stefaniuk

Enum Constant Summary
CUSTOM_ERROR
           
INTERNAL_ERROR
           
INVALID_PARAMS
           
INVALID_REQUEST
           
METHOD_NOT_FOUND
           
PARSE_ERROR
           
SERVER_ERROR
           
 
Method Summary
 int getCode()
          Returns error code.
 String getMessage()
          Returns error message.
 void setMessage(String message)
          Sets error message.
static JsonServiceError valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JsonServiceError[] 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

PARSE_ERROR

public static final JsonServiceError PARSE_ERROR

INTERNAL_ERROR

public static final JsonServiceError INTERNAL_ERROR

INVALID_PARAMS

public static final JsonServiceError INVALID_PARAMS

METHOD_NOT_FOUND

public static final JsonServiceError METHOD_NOT_FOUND

INVALID_REQUEST

public static final JsonServiceError INVALID_REQUEST

SERVER_ERROR

public static final JsonServiceError SERVER_ERROR

CUSTOM_ERROR

public static final JsonServiceError CUSTOM_ERROR
Method Detail

values

public static JsonServiceError[] 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 (JsonServiceError c : JsonServiceError.values())
    System.out.println(c);

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

valueOf

public static JsonServiceError 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()
Returns error code.

Returns:
Returns error code.

getMessage

public String getMessage()
Returns error message.

Returns:
Returns error message.

setMessage

public void setMessage(String message)
Sets error message.



Copyright © 2013. All Rights Reserved.