app
Enum Error

java.lang.Object
  extended by java.lang.Enum<Error>
      extended by app.Error
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Error>

public enum Error
extends java.lang.Enum<Error>

Representation of possible errors coupled with error codes


Enum Constant Summary
ARG_COUNT
           
FILE_READ
           
INVALID_VALUE
           
MISSING_ARG
           
REQUIRED_ARG_NOT_FOUND
           
STREAM_WRITE
           
UNKNOWN_ARG
           
 
Method Summary
 java.lang.String description()
           
 java.lang.String description(int num)
           
 java.lang.String description(java.lang.String msg)
           
 java.lang.String description(java.lang.String opt, java.lang.String val)
           
 int errcode()
          The error code representing the error.
static Error valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Error[] 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

ARG_COUNT

public static final Error ARG_COUNT

UNKNOWN_ARG

public static final Error UNKNOWN_ARG

REQUIRED_ARG_NOT_FOUND

public static final Error REQUIRED_ARG_NOT_FOUND

MISSING_ARG

public static final Error MISSING_ARG

INVALID_VALUE

public static final Error INVALID_VALUE

FILE_READ

public static final Error FILE_READ

STREAM_WRITE

public static final Error STREAM_WRITE
Method Detail

values

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

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

valueOf

public static Error valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

description

public java.lang.String description()
Returns:
a description of the error

description

public java.lang.String description(java.lang.String msg)
Parameters:
msg - extra message to attach
Returns:
a description of the error

description

public java.lang.String description(java.lang.String opt,
                                    java.lang.String val)
Parameters:
opt - specify the option
val - value of the option
Returns:
a description of the error

description

public java.lang.String description(int num)
Parameters:
num - a number to attach
Returns:
a description of the error

errcode

public int errcode()
The error code representing the error. This will change along with the ordering of the errors.

Returns:
the error's code