Package java.lang
Class EnumConstantNotPresentException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.EnumConstantNotPresentException
-
- All Implemented Interfaces:
Serializable
public class EnumConstantNotPresentException extends RuntimeException
Thrown if anenumconstant does not exist for a particular name.- Since:
- 1.5
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EnumConstantNotPresentException(Class<? extends Enum> enumType, String constantName)Constructs a newEnumConstantNotPresentExceptionwith the current stack trace and a detail message based on the specified enum type and missing constant name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringconstantName()Gets the name of the missing constant.Class<? extends Enum>enumType()Gets the enum type for which the constant name is missing.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
EnumConstantNotPresentException
public EnumConstantNotPresentException(Class<? extends Enum> enumType, String constantName)
Constructs a newEnumConstantNotPresentExceptionwith the current stack trace and a detail message based on the specified enum type and missing constant name.- Parameters:
enumType- the enum type.constantName- the missing constant name.
-
-
Method Detail
-
enumType
public Class<? extends Enum> enumType()
Gets the enum type for which the constant name is missing.- Returns:
- the enum type for which a constant name has not been found.
-
constantName
public String constantName()
Gets the name of the missing constant.- Returns:
- the name of the constant that has not been found in the enum type.
-
-