final RpcInvocationStrategy rpc = rpcNames.get(method);
if (rpc != null) {
- if (method.getParameterTypes().length == 0) {
+ if (method.getParameterCount() == 0) {
return rpc.invokeEmpty();
}
if (args.length != 1) {
switch (method.getName()) {
case "toString":
- if (method.getReturnType().equals(String.class) && method.getParameterTypes().length == 0) {
+ if (method.getReturnType().equals(String.class) && method.getParameterCount() == 0) {
return type.getName() + "$Adapter{delegate=" + delegate.toString() + "}";
}
break;
case "hashCode":
- if (method.getReturnType().equals(int.class) && method.getParameterTypes().length == 0) {
+ if (method.getReturnType().equals(int.class) && method.getParameterCount() == 0) {
return System.identityHashCode(proxy);
}
break;
case "equals":
- if (method.getReturnType().equals(boolean.class) && method.getParameterTypes().length == 1
+ if (method.getReturnType().equals(boolean.class) && method.getParameterCount() == 1
&& method.getParameterTypes()[0] == Object.class) {
return proxy == args[0];
}
final Map<String, DataSchemaNode> getterToLeafSchema) {
final Map<String, LeafNodeCodecContext<?>> leaves = new HashMap<>();
for (final Method method : parentClass.getMethods()) {
- if (method.getParameterTypes().length == 0) {
+ if (method.getParameterCount() == 0) {
final DataSchemaNode schema = getterToLeafSchema.get(method.getName());
final Class<?> valueType;
if (schema instanceof LeafSchemaNode) {
@Override
public Object invoke(final Object proxy, final Method method, final Object[] args) {
- if (method.getParameterTypes().length == 0) {
+ if (method.getParameterCount() == 0) {
final String name = method.getName();
if (DATA_CONTAINER_GET_IMPLEMENTED_INTERFACE_NAME.equals(name)) {
return context.getBindingClass();
}
}
assertNotNull(fieldsFromMethod);
- assertEquals(1, fieldsFromMethod.getParameterTypes().length);
+ assertEquals(1, fieldsFromMethod.getParameterCount());
cleanUp(sourcesOutputDir, compiledOutputDir);
}
// resolveRpcInputClass() check.While RpcMethodInvoker counts with one argument for
// non input type and two arguments for input type, resolveRpcInputClass() counting
// with zero for non input and one for input type
- && possibleMethod.getParameterTypes().length <= 2;
+ && possibleMethod.getParameterCount() <= 2;
}
/**
*/
public static boolean isNotificationCallback(final Method method) {
checkArgument(method != null);
- if (method.getName().startsWith("on") && method.getParameterTypes().length == 1) {
+ if (method.getName().startsWith("on") && method.getParameterCount() == 1) {
Class<?> potentialNotification = method.getParameterTypes()[0];
if (isNotification(potentialNotification)
&& method.getName().equals("on" + potentialNotification.getSimpleName())) {
private static Optional<Class<? extends DataContainer>> getYangModeledReturnType(final Method method,
final String prefix) {
final String methodName = method.getName();
- if ("getClass".equals(methodName) || !methodName.startsWith(prefix) || method.getParameterTypes().length > 0) {
+ if ("getClass".equals(methodName) || !methodName.startsWith(prefix) || method.getParameterCount() > 0) {
return Optional.empty();
}