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
EnumConstantNotPresentException is thrown when an attempt is made
to access an enum element by name and such an element does not exist.
- Since:
- 1.5
- See Also:
- Serialized Form
Method Summary |
String |
constantName()
constantName returns the name of the missing constant. |
Class<? extends Enum> |
enumType()
enumType returns the enumeration type that did not contain the
constant. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
EnumConstantNotPresentException
public EnumConstantNotPresentException(Class<? extends Enum> type,
String name)
- Constructor for a new instance of this exception.
- Parameters:
type
- the enum type, must not be null.name
- the name of the missing constant, must not be null.
enumType
public Class<? extends Enum> enumType()
- enumType returns the enumeration type that did not contain the
constant.
- Returns:
- the enum type, never null.
constantName
public String constantName()
- constantName returns the name of the missing constant.
- Returns:
- the name of the constant, never null.
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2015 aicas GmbH. All Rights Reserved.