Class TypeMismatchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.demeng.pluginbase.exceptions.BaseException
dev.demeng.pluginbase.di.exception.DependencyException
dev.demeng.pluginbase.di.exception.TypeMismatchException
- All Implemented Interfaces:
Serializable
Exception thrown when attempting to register an instance with a type that is not assignable from
the instance's actual class.
This occurs when trying to register an instance with an incompatible explicit type parameter.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTypeMismatchException(@NotNull Class<?> expected, @NotNull Class<?> actual) Creates a new type mismatch exception with details about the expected and actual types. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TypeMismatchException
public TypeMismatchException(@NotNull @NotNull Class<?> expected, @NotNull @NotNull Class<?> actual) Creates a new type mismatch exception with details about the expected and actual types.- Parameters:
expected- The expected type (what was specified in register)actual- The actual type of the instance
-