public static boolean isSetter(Method method) { return method.getName().startsWith("set") && !"set".equals(method.getName()) && Modifier.isPublic(method.getModifiers()) && method.getParameterCount() == 1 && isPrimitive(method.getParameterTypes()[0]); }
public static boolean isGetter(Method method) { String name = method.getName(); return (name.startsWith("get") || name.startsWith("is")) && !"get".equals(name) && !"is".equals(name) && !"getClass".equals(name) && !"getObject".equals(name) && Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0 && isPrimitive(method.getReturnType()); }
public static boolean isSetter(Method method) { return method.getName().startsWith("set") && !"set".equals(method.getName()) && Modifier.isPublic(method.getModifiers()) && method.getParameterCount() == 1 && isPrimitive(method.getParameterTypes()[0]); }
public static boolean isGetter(Method method) { String name = method.getName(); return (name.startsWith("get") || name.startsWith("is")) && !"get".equals(name) && !"is".equals(name) && !"getClass".equals(name) && !"getObject".equals(name) && Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0 && isPrimitive(method.getReturnType()); }
private boolean isMetaMethod(Method method) { String name = method.getName(); if (!(name.startsWith("get") || name.startsWith("is"))) { return false; } if ("get".equals(name)) { return false; } if ("getClass".equals(name)) { return false; } if (!Modifier.isPublic(method.getModifiers())) { return false; } if (method.getParameterTypes().length != 0) { return false; } if (!ClassHelper.isPrimitive(method.getReturnType())) { return false; } return true; }
private boolean isMetaMethod(Method method) { String name = method.getName(); if (!(name.startsWith("get") || name.startsWith("is"))) { return false; } if ("get".equals(name)) { return false; } if ("getClass".equals(name)) { return false; } if (!Modifier.isPublic(method.getModifiers())) { return false; } if (method.getParameterTypes().length != 0) { return false; } if (!ClassHelper.isPrimitive(method.getReturnType())) { return false; } return true; }
@Override public boolean equals(Object obj) { if (obj == null || !(obj.getClass().getName().equals(this.getClass().getName()))) { return false; } Method[] methods = this.getClass().getMethods(); for (Method method1 : methods) { if (ClassHelper.isGetter(method1) && ClassHelper.isPrimitive(method1.getReturnType())) { Parameter parameter = method1.getAnnotation(Parameter.class); if (parameter != null && parameter.excluded()) { continue; } try { Method method2 = obj.getClass().getMethod(method1.getName(), method1.getParameterTypes()); Object value1 = method1.invoke(this, new Object[]{}); Object value2 = method2.invoke(obj, new Object[]{}); if ((value1 != null && value2 != null) && !value1.equals(value2)) { return false; } } catch (Exception e) { return true; } } } return true; } }
@Override public boolean equals(Object obj) { if (obj == null || !(obj.getClass().getName().equals(this.getClass().getName()))) { return false; } Method[] methods = this.getClass().getMethods(); for (Method method1 : methods) { if (ClassHelper.isGetter(method1) && ClassHelper.isPrimitive(method1.getReturnType())) { Parameter parameter = method1.getAnnotation(Parameter.class); if (parameter != null && parameter.excluded()) { continue; } try { Method method2 = obj.getClass().getMethod(method1.getName(), method1.getParameterTypes()); Object value1 = method1.invoke(this, new Object[]{}); Object value2 = method2.invoke(obj, new Object[]{}); if ((value1 != null && value2 != null) && !value1.equals(value2)) { return false; } } catch (Exception e) { return true; } } } return true; } }
public static boolean isGetter(Method method) { String name = method.getName(); return (name.startsWith("get") || name.startsWith("is")) && !"get".equals(name) && !"is".equals(name) && !"getClass".equals(name) && !"getObject".equals(name) && Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0 && isPrimitive(method.getReturnType()); }
public static boolean isSetter(Method method) { return method.getName().startsWith("set") && !"set".equals(method.getName()) && Modifier.isPublic(method.getModifiers()) && method.getParameterCount() == 1 && isPrimitive(method.getParameterTypes()[0]); }
public static boolean isSetter(Method method) { return method.getName().startsWith("set") && !"set".equals(method.getName()) && Modifier.isPublic(method.getModifiers()) && method.getParameterCount() == 1 && isPrimitive(method.getParameterTypes()[0]); }
public static boolean isGetter(Method method) { String name = method.getName(); return (name.startsWith("get") || name.startsWith("is")) && !"get".equals(name) && !"is".equals(name) && !"getClass".equals(name) && !"getObject".equals(name) && Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0 && isPrimitive(method.getReturnType()); }
@Override public boolean equals(Object obj) { if (obj == null || !(obj.getClass().getName().equals(this.getClass().getName()))) { return false; } Method[] methods = this.getClass().getMethods(); for (Method method1 : methods) { if (ClassHelper.isGetter(method1) && ClassHelper.isPrimitive(method1.getReturnType())) { Parameter parameter = method1.getAnnotation(Parameter.class); if (parameter != null && parameter.excluded()) { continue; } try { Method method2 = obj.getClass().getMethod(method1.getName(), method1.getParameterTypes()); Object value1 = method1.invoke(this, new Object[]{}); Object value2 = method2.invoke(obj, new Object[]{}); if ((value1 != null && value2 != null) && !value1.equals(value2)) { return false; } } catch (Exception e) { return true; } } } return true; } }
@Override public boolean equals(Object obj) { if (obj == null || !(obj.getClass().getName().equals(this.getClass().getName()))) { return false; } Method[] methods = this.getClass().getMethods(); for (Method method1 : methods) { if (ClassHelper.isGetter(method1) && ClassHelper.isPrimitive(method1.getReturnType())) { Parameter parameter = method1.getAnnotation(Parameter.class); if (parameter != null && parameter.excluded()) { continue; } try { Method method2 = obj.getClass().getMethod(method1.getName(), method1.getParameterTypes()); Object value1 = method1.invoke(this, new Object[]{}); Object value2 = method2.invoke(obj, new Object[]{}); if ((value1 != null && value2 != null) && !value1.equals(value2)) { return false; } } catch (Exception e) { return true; } } } return true; } }
&& Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0 && ClassHelper.isPrimitive(method.getReturnType())) { String prop = calculateAttributeFromGetter(name); String key;
&& Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0 && ClassHelper.isPrimitive(method.getReturnType())) { String prop = calculateAttributeFromGetter(name); String key;