Package com.cleancoder.args
Class ArgsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.cleancoder.args.ArgsException
- All Implemented Interfaces:
Serializable
public class ArgsException extends Exception
This class is responsible for handling all exceptions in
com.cleancoder.args package.- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArgsException.ErrorCodeList of enums for different exceptions. -
Field Summary
Fields Modifier and Type Field Description private charerrorArgumentIdprivate ArgsException.ErrorCodeerrorCodeprivate StringerrorParameter -
Constructor Summary
Constructors Constructor Description ArgsException(ArgsException.ErrorCode errorCode)ArgsException(ArgsException.ErrorCode errorCode, char errorArgumentId, String errorParameter)ArgsException(ArgsException.ErrorCode errorCode, String errorParameter) -
Method Summary
Modifier and Type Method Description StringerrorMessage()Generates error message for enums.chargetErrorArgumentId()ArgsException.ErrorCodegetErrorCode()StringgetErrorParameter()voidsetErrorArgumentId(char errorArgumentId)Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
errorArgumentId
private char errorArgumentId -
errorParameter
-
errorCode
-
-
Constructor Details
-
ArgsException
-
ArgsException
-
ArgsException
public ArgsException(ArgsException.ErrorCode errorCode, char errorArgumentId, String errorParameter)
-
-
Method Details
-
getErrorArgumentId
public char getErrorArgumentId() -
setErrorArgumentId
public void setErrorArgumentId(char errorArgumentId) -
getErrorParameter
-
getErrorCode
-
errorMessage
Generates error message for enums. This helps in giving user a meaningful feedback when the input is invalid.- Returns:
- none
- See Also:
ArgsException.ErrorCode
-