Top Description Fields Constructors Methods
java.lang

public Class EnumConstantNotPresentException

extends RuntimeException
Class Inheritance
Annotations
@SuppressWarnings:rawtypes

Thrown when an application tries to access an enum constant by name and the enum type contains no constant with the specified name. This exception can be thrown by the API used to read annotations reflectively.
Author
Josh Bloch
Since
1.5
See Also
java.lang.reflect.AnnotatedElement

Field Summary

Modifier and TypeField and Description
private String
constantName

The name of the missing enum constant.

private Class<? extends Enum<E extends Enum<E>>>
enumType

The type of the missing enum constant.

private static final long

Constructor Summary

AccessConstructor and Description
public
EnumConstantNotPresentException(Class<? extends Enum<E extends Enum<E>>>
the type of the missing enum constant
enumType
,
String
the name of the missing enum constant
constantName
)

Constructs an EnumConstantNotPresentException for the specified constant.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of the missing enum constant
constantName
()

Returns the name of the missing enum constant.

public Class<? extends Enum<E extends Enum<E>>>

Returns:

the type of the missing enum constant
enumType
()

Returns the type of the missing enum constant.

Field Detail

constantNameback to summary
private String constantName

The name of the missing enum constant.

enumTypeback to summary
private Class<? extends Enum<E extends Enum<E>>> enumType

The type of the missing enum constant.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Annotations
@Serial

Constructor Detail

EnumConstantNotPresentExceptionback to summary
public EnumConstantNotPresentException(Class<? extends Enum<E extends Enum<E>>> enumType, String constantName)

Constructs an EnumConstantNotPresentException for the specified constant.

Parameters
enumType:Class<? extends Enum<E extends Enum<E>>>

the type of the missing enum constant

constantName:String

the name of the missing enum constant

Method Detail

constantNameback to summary
public String constantName()

Returns the name of the missing enum constant.

Returns:String

the name of the missing enum constant

enumTypeback to summary
public Class<? extends Enum<E extends Enum<E>>> enumType()

Returns the type of the missing enum constant.

Returns:Class<? extends Enum<E extends Enum<E>>>

the type of the missing enum constant