mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-12 02:11:45 +01: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);
|
||||
}
|
||||
|
||||
public T callMethod(DataExtension of, Parameters with) {
|
||||
public T callMethod(DataExtension extension, Parameters with) {
|
||||
try {
|
||||
return returnType.cast(with.call(of, method));
|
||||
return returnType.cast(with.usingOn(extension, method));
|
||||
} catch (InvocationTargetException notReadyToBeCalled) {
|
||||
if (notReadyToBeCalled.getCause() instanceof NotReadyException) {
|
||||
return null; // Data or API not available to make the call.
|
||||
|
@ -37,7 +37,7 @@ public interface Parameters {
|
||||
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();
|
||||
|
||||
@ -59,7 +59,7 @@ public interface Parameters {
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ public interface Parameters {
|
||||
}
|
||||
|
||||
@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];
|
||||
if (UUID.class.equals(parameterType)) {
|
||||
return method.invoke(extension, playerUUID);
|
||||
@ -118,7 +118,7 @@ public interface Parameters {
|
||||
}
|
||||
|
||||
@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;
|
||||
return method.invoke(extension, group);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user