This repository has been archived on 2021-02-18. You can view files and clone it, but cannot push or open issues or pull requests.
chess/src/dev/kske/chess/event/Invocation.java

30 lines
730 B
Java

package dev.kske.chess.event;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Project: <strong>Chess</strong><br>
* File: <strong>Invocation.java</strong><br>
* Created: <strong>02.08.2019</strong><br>
* Author: <strong>Kai S. K. Engelbart</strong>
*/
public final class Invocation {
private final Method method;
private final Object object;
public Invocation(Method method, Object object) {
this.method = method;
this.object = object;
}
public void invoke(Object arg) {
try {
method.invoke(object, arg);
} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException ex) {
ex.printStackTrace();
}
}
}