improve wrapper and general structure #16

Merged
tueem merged 23 commits from improve/structure into dev 2025-03-17 08:26:44 +00:00
Showing only changes of commit d4a91f3251 - Show all commits

View File

@ -40,11 +40,12 @@ public class InteractionRegistry {
for (Method method : interactionHandler.getClass().getMethods()) { for (Method method : interactionHandler.getClass().getMethods()) {
InteractionMethod iMethod = InteractionMethod.create(method, interactionHandler, marinara); InteractionMethod iMethod = InteractionMethod.create(method, interactionHandler, marinara);
if (iMethod != null) { if (iMethod != null) {
Optional<InteractionEntry> entry = this.interactions.stream().filter(iMethod::equals).findFirst(); Optional<InteractionEntry> oentry = this.interactions.stream()
if (entry.isEmpty()) { .filter(i -> i.identifier().equals(iMethod.identifier()))
interactions.add(new InteractionEntry(iMethod.identifier()).addMethod(iMethod)); .findFirst();
}else
entry.get().addMethod(iMethod); InteractionEntry entry = oentry.orElse(new InteractionEntry(iMethod.identifier())).addMethod(iMethod);
if (oentry.isEmpty()) this.interactions.add(entry);
logger.debug("Added {} method from {}", iMethod.method().getName(), interactionHandler.getClass().getSimpleName()); logger.debug("Added {} method from {}", iMethod.method().getName(), interactionHandler.getClass().getSimpleName());
} }
} }