mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-10-23 12:59:55 +02:00
Renamed Parameters#call to #usingOn
This commit is contained in:
parent
43f18c78aa
commit
274bd2755b
@ -41,9 +41,9 @@ public class MethodWrapper<T> {
|
|||||||
methodType = MethodType.forMethod(this.method);
|
methodType = MethodType.forMethod(this.method);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T callMethod(DataExtension of, Parameters with) {
|
public T callMethod(DataExtension extension, Parameters with) {
|
||||||
try {
|
try {
|
||||||
return returnType.cast(with.call(of, method));
|
return returnType.cast(with.usingOn(extension, method));
|
||||||
} catch (InvocationTargetException notReadyToBeCalled) {
|
} catch (InvocationTargetException notReadyToBeCalled) {
|
||||||
if (notReadyToBeCalled.getCause() instanceof NotReadyException) {
|
if (notReadyToBeCalled.getCause() instanceof NotReadyException) {
|
||||||
return null; // Data or API not available to make the call.
|
return null; // Data or API not available to make the call.
|
||||||
|
@ -37,7 +37,7 @@ public interface Parameters {
|
|||||||
return new GroupParameters(serverUUID, groupName);
|
return new GroupParameters(serverUUID, groupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object call(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException;
|
Object usingOn(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException;
|
||||||
|
|
||||||
MethodType getMethodType();
|
MethodType getMethodType();
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ public interface Parameters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object call(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException {
|
public Object usingOn(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException {
|
||||||
return method.invoke(extension);
|
return method.invoke(extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ public interface Parameters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object call(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException {
|
public Object usingOn(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException {
|
||||||
Class<?> parameterType = method.getParameterTypes()[0];
|
Class<?> parameterType = method.getParameterTypes()[0];
|
||||||
if (UUID.class.equals(parameterType)) {
|
if (UUID.class.equals(parameterType)) {
|
||||||
return method.invoke(extension, playerUUID);
|
return method.invoke(extension, playerUUID);
|
||||||
@ -118,7 +118,7 @@ public interface Parameters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object call(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException {
|
public Object usingOn(DataExtension extension, Method method) throws InvocationTargetException, IllegalAccessException {
|
||||||
Group group = this::getGroupName;
|
Group group = this::getGroupName;
|
||||||
return method.invoke(extension, group);
|
return method.invoke(extension, group);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user