public class TypeCastException extends ClassCastException
| Constructor and Description |
|---|
TypeCastException(Class<?> type,
Object subject)
Instantiates a new instance with the target type and the subject instance that caused the exception and
no explicit message.
|
TypeCastException(Class<?> type,
Object subject,
String message)
Instantiates a new instance with the target type and the subject instance that caused the exception and
an explicit message.
|
| Modifier and Type | Method and Description |
|---|---|
String |
assembleDetailString() |
protected String |
assembleExplicitMessageAddon() |
String |
assembleOutputString() |
String |
getMessage()
Returns an assembled output String due to bad method design in
Throwable. |
String |
message()
Sadly, the Throwable implementation uses #getMessage() directly to print the exception.
|
Object |
subject()
The subject that could not be casted.
|
Class<?> |
type()
The target type the subject could not be casted to.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic TypeCastException(Class<?> type, Object subject)
type - the target type the subject could not be casted to.subject - the subject that could not be casted.public TypeCastException(Class<?> type, Object subject, String message)
type - the target type the subject could not be casted to.subject - the subject that could not be casted.message - an arbitrary string used as a custom message.public final Class<?> type()
public final Object subject()
public final String message()
public String assembleDetailString()
protected String assembleExplicitMessageAddon()
public String assembleOutputString()
public String getMessage()
Throwable.
For the actual message getter, see message().getMessage in class ThrowableCopyright © 2022 MicroStream Software. All rights reserved.