- add prototype Interactioncheck impementation.
All checks were successful
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 12s
Test / Gradle-Test (push) Successful in 16s

- refactor dependency injection to have all widely used dependencies in the Marinara class.
This commit is contained in:
2024-11-28 10:32:48 +01:00
parent 582e0f0bae
commit f89ae5e425
9 changed files with 183 additions and 42 deletions

View File

@@ -0,0 +1,26 @@
package net.tomatentum.marinara.checks;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
public record AppliedCheck(InteractionCheck<?> check, Annotation annotation) {
public boolean pre() {
try {
return (boolean) check.getClass().getMethod("preExec", annotation.getClass()).invoke(check, annotation);
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
e.printStackTrace();
return false;
}
}
public boolean post() {
try {
return (boolean) check.getClass().getMethod("postExec", annotation.getClass()).invoke(check, annotation);
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
e.printStackTrace();
return false;
}
}
}