Renamed Parameters#call to #usingOn

This commit is contained in:
Rsl1122 2020-01-26 23:00:56 +02:00
parent 43f18c78aa
commit 274bd2755b
2 changed files with 6 additions and 6 deletions

View File

@ -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.

View File

@ -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);
}