Add instanceof argument checking methods to KiwiPreconditions #980
Labels
new feature
A new feature such as a new class, method, package, group of classes, etc.
Milestone
In kiwi-beta I recently needed to check that an argument was not of a specific type:
This task is to add methods to
KiwiPreconditions
to check if an argument is an instance of a given type, or not of a given type.Proposed base method signatures:
checkArgumentInstanceOf(Object argument, Class<?> requiredType)
checkArgumentNotInstanceOf(Object argument, Class<?> restrictedType)
Since you can't use
instanceof
with a variable, these will have to useClass#isAssignableFrom
instead.In addition, there should be the standard three variants of each of the above:
The text was updated successfully, but these errors were encountered: