@Override public MethodSource<O> getMethod(final String name) { for (MethodSource<O> method : getMethods()) { if (method.getName().equals(name) && (method.getParameters().size() == 0)) { return method; } } return null; }
@Override public MethodSource<Body> getMethod(final String name) { for (MethodSource<Body> method : getMethods()) { if (method.getName().equals(name) && (method.getParameters().isEmpty())) { return method; } } return null; }
@Override public MethodSource<Body> getMethod(final String name) { for (MethodSource<Body> method : getMethods()) { if (method.getName().equals(name) && (method.getParameters().isEmpty())) { return method; } } return null; }
@Override public MethodSource<O> getMethod(final String name) { for (MethodSource<O> method : getMethods()) { if (method.getName().equals(name) && (method.getParameters().size() == 0)) { return method; } } return null; }
@Override public MethodSource<O> getMethod(final String name) { for (MethodSource<O> method : getMethods()) { if (method.getName().equals(name) && (method.getParameters().size() == 0)) { return method; } } return null; }
@Override public MethodSource<Body> getMethod(final String name) { for (MethodSource<Body> method : getMethods()) { if (method.getName().equals(name) && (method.getParameters().isEmpty())) { return method; } } return null; }
@Override public MethodSource<Body> getMethod(final String name, final String... paramTypes) { for (MethodSource<Body> local : getMethods()) { if (local.getName().equals(name)) { final List<ParameterSource<Body>> localParams = local.getParameters(); if (paramTypes != null) { if (localParams.isEmpty() || (localParams.size() == paramTypes.length)) { boolean matches = true; for (int i = 0; i < localParams.size(); i++) { if (!Types.areEquivalent(localParams.get(i).getType().getName(), paramTypes[i])) { matches = false; } } if (matches) { return local; } } } } } return null; }
@Override public MethodSource<O> getMethod(final String name, final String... paramTypes) { for (MethodSource<O> local : getMethods()) { if (local.getName().equals(name)) { List<ParameterSource<O>> localParams = local.getParameters(); if (paramTypes != null) { if (localParams.isEmpty() || (localParams.size() == paramTypes.length)) { boolean matches = true; for (int i = 0; i < localParams.size(); i++) { ParameterSource<O> localParam = localParams.get(i); String type = paramTypes[i]; if (!Types.areEquivalent(localParam.getType().getName(), type)) { matches = false; } } if (matches) return local; } } } } return null; }
public boolean isEquals(MethodSource<?> method) { return method.getName().equals("equals") && (method.getParameters() == null || method.getParameters().size() == 1) && method.getReturnType() != null && method.getReturnType().isPrimitive() && "boolean".equals(method.getReturnType().getName()); }
public boolean isHashCode(MethodSource<?> method) { return method.getName().equals("hashCode") && (method.getParameters() == null || method.getParameters().size() == 0) && method.getReturnType() != null && method.getReturnType().isPrimitive() && "int".equals(method.getReturnType().getName()); }
@Override public MethodSource<Body> getMethod(final String name, final String... paramTypes) { for (MethodSource<Body> local : getMethods()) { if (local.getName().equals(name)) { final List<ParameterSource<Body>> localParams = local.getParameters(); if (paramTypes != null) { if (localParams.isEmpty() || (localParams.size() == paramTypes.length)) { boolean matches = true; for (int i = 0; i < localParams.size(); i++) { if (!Types.areEquivalent(localParams.get(i).getType().getName(), paramTypes[i])) { matches = false; } } if (matches) { return local; } } } } } return null; }
@Override public MethodSource<Body> getMethod(final String name, final String... paramTypes) { for (MethodSource<Body> local : getMethods()) { if (local.getName().equals(name)) { final List<ParameterSource<Body>> localParams = local.getParameters(); if (paramTypes != null) { if (localParams.isEmpty() || (localParams.size() == paramTypes.length)) { boolean matches = true; for (int i = 0; i < localParams.size(); i++) { if (!Types.areEquivalent(localParams.get(i).getType().getName(), paramTypes[i])) { matches = false; } } if (matches) { return local; } } } } } return null; }
@Override public MethodSource<O> getMethod(final String name, final String... paramTypes) { for (MethodSource<O> local : getMethods()) { if (local.getName().equals(name)) { List<ParameterSource<O>> localParams = local.getParameters(); if (paramTypes != null) { if (localParams.size() == paramTypes.length) { boolean matches = true; for (int i = 0; i < localParams.size(); i++) { ParameterSource<O> localParam = localParams.get(i); String type = paramTypes[i]; if (!Types.areEquivalent(localParam.getType().getName(), type)) { matches = false; } } if (matches) return local; } } } } return null; }
@Override public MethodSource<O> getMethod(final String name, final String... paramTypes) { for (MethodSource<O> local : getMethods()) { if (local.getName().equals(name)) { List<ParameterSource<O>> localParams = local.getParameters(); if (paramTypes != null) { if (localParams.size() == paramTypes.length) { boolean matches = true; for (int i = 0; i < localParams.size(); i++) { ParameterSource<O> localParam = localParams.get(i); String type = paramTypes[i]; if (!Types.areEquivalent(localParam.getType().getName(), type)) { matches = false; } } if (matches) return local; } } } } return null; }
@Override public boolean hasMethodSignature(final Method<?, ?> method) { for (MethodSource<O> local : getMethods()) { if (local.getName().equals(method.getName())) { Iterator<ParameterSource<O>> localParams = local.getParameters().iterator(); for (Parameter<? extends JavaType<?>> methodParam : method.getParameters()) { if (localParams.hasNext() && Strings.areEqual(localParams.next().getType().getName(), methodParam.getType().getName())) { continue; } return false; } return !localParams.hasNext(); } } return false; }
@Override public boolean hasMethodSignature(final Method<?, ?> method) { for (MethodSource<Body> local : getMethods()) { if (local.getName().equals(method.getName())) { final Iterator<ParameterSource<Body>> localParams = local.getParameters().iterator(); for (Parameter<? extends JavaType<?>> methodParam : method.getParameters()) { if (localParams.hasNext() && Strings.areEqual(localParams.next().getType().getName(), methodParam.getType().getName())) { continue; } return false; } return !localParams.hasNext(); } } return false; }
@Override public boolean hasMethodSignature(final Method<?, ?> method) { for (MethodSource<Body> local : getMethods()) { if (local.getName().equals(method.getName())) { final Iterator<ParameterSource<Body>> localParams = local.getParameters().iterator(); for (Parameter<? extends JavaType<?>> methodParam : method.getParameters()) { if (localParams.hasNext() && Strings.areEqual(localParams.next().getType().getName(), methodParam.getType().getName())) { continue; } return false; } return !localParams.hasNext(); } } return false; }
@Override public boolean hasMethodSignature(final Method<?, ?> method) { for (MethodSource<O> local : getMethods()) { if (local.getName().equals(method.getName())) { Iterator<ParameterSource<O>> localParams = local.getParameters().iterator(); for (Parameter<? extends JavaType<?>> methodParam : method.getParameters()) { if (localParams.hasNext() && Strings.areEqual(localParams.next().getType().getName(), methodParam.getType().getName())) { continue; } return false; } return !localParams.hasNext(); } } return false; }
@Override public boolean hasMethodSignature(final Method<?, ?> method) { for (MethodSource<Body> local : getMethods()) { if (local.getName().equals(method.getName())) { final Iterator<ParameterSource<Body>> localParams = local.getParameters().iterator(); for (Parameter<? extends JavaType<?>> methodParam : method.getParameters()) { if (localParams.hasNext() && Strings.areEqual(localParams.next().getType().getName(), methodParam.getType().getName())) { continue; } return false; } return !localParams.hasNext(); } } return false; }
@Override public boolean hasMethodSignature(final Method<?, ?> method) { for (MethodSource<O> local : getMethods()) { if (local.getName().equals(method.getName())) { Iterator<ParameterSource<O>> localParams = local.getParameters().iterator(); for (Parameter<? extends JavaType<?>> methodParam : method.getParameters()) { if (localParams.hasNext() && Strings.areEqual(localParams.next().getType().getName(), methodParam.getType().getName())) { continue; } return false; } return !localParams.hasNext(); } } return false; }