FileDocCategorySizeDatePackage
EnumConstantNotPresentException.javaAPI DocJava SE 5 API1579Fri Aug 26 14:57:02 BST 2005java.lang

EnumConstantNotPresentException

public class EnumConstantNotPresentException extends RuntimeException
Thrown when an application tries to access an enum constant by name and the enum type contains no constant with the specified name.
author
Josh Bloch
since
1.5

Fields Summary
private Class
enumType
The type of the missing enum constant.
private String
constantName
The name of the missing enum constant.
Constructors Summary
public EnumConstantNotPresentException(Class enumType, String constantName)
Constructs an EnumConstantNotPresentException for the specified constant.

param
enumType the type of the missing enum constant
param
constantName the name of the missing enum constant

        super(enumType.getName() + "." + constantName);
	this.enumType = enumType;
	this.constantName  = constantName;
    
Methods Summary
public java.lang.StringconstantName()
Returns the name of the missing enum constant.

return
the name of the missing enum constant

 return constantName; 
public java.lang.ClassenumType()
Returns the type of the missing enum constant.

return
the type of the missing enum constant

 return enumType;