From 53a6bb1deee20ab5298a56fd06f434ef9e86de68 Mon Sep 17 00:00:00 2001 From: Dabo Ross Date: Thu, 5 Sep 2013 21:23:59 -0700 Subject: [PATCH] Added EventHandlerMethod wrapper for Listener and Method --- .../md_5/bungee/event/EventHandlerMethod.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 event/src/main/java/net/md_5/bungee/event/EventHandlerMethod.java diff --git a/event/src/main/java/net/md_5/bungee/event/EventHandlerMethod.java b/event/src/main/java/net/md_5/bungee/event/EventHandlerMethod.java new file mode 100644 index 00000000..fb72c438 --- /dev/null +++ b/event/src/main/java/net/md_5/bungee/event/EventHandlerMethod.java @@ -0,0 +1,25 @@ +package net.md_5.bungee.event; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * + * @author daboross + */ +@AllArgsConstructor +public class EventHandlerMethod +{ + + @Getter + private final Object listener; + @Getter + private final Method method; + + public void invoke(Object event) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException + { + method.invoke( listener, event ); + } +}