@Test public void testSetsAreEqual() { JsonTypeDescriptor descriptor = new JsonTypeDescriptor(); Form theFirst = createForm(1, 2, 3); Form theSecond = createForm(3, 2, 1); assertTrue(descriptor.areEqual(theFirst, theSecond)); }
@Override public boolean areEqual(Object one, Object another) { if (one == another) { return true; } if (one == null || another == null) { return false; } if (one instanceof String && another instanceof String) { return one.equals(another); } if (one instanceof Collection && another instanceof Collection) { return Objects.equals(one, another); } if (one.getClass().equals(another.getClass()) && ReflectionUtils.getDeclaredMethodOrNull(one.getClass(), "equals", Object.class) != null) { return one.equals(another); } return objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(one)).equals( objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(another)) ); }
JsonTypeDescriptor extends AbstractTypeDescriptor<Object> implements DynamicParameterizedType { @Override public boolean areEqual(Object one, Object another) { if (one == another) { return true; } if (one == null || another == null) { return false; } if (one instanceof String && another instanceof String) { return one.equals(another); } if (one instanceof Collection && another instanceof Collection) { return Objects.equals(one, another); } if (one.getClass().equals(another.getClass()) && ReflectionUtils.getDeclaredMethodOrNull(one.getClass(), "equals", Object.class) != null) { return one.equals(another); } return objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(one)).equals( objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(another)) ); } }
JsonTypeDescriptor extends AbstractTypeDescriptor<Object> implements DynamicParameterizedType { @Override public boolean areEqual(Object one, Object another) { if (one == another) { return true; } if (one == null || another == null) { return false; } if (one instanceof String && another instanceof String) { return one.equals(another); } if (one instanceof Collection && another instanceof Collection) { return Objects.equals(one, another); } if (one.getClass().equals(another.getClass()) && ReflectionUtils.getDeclaredMethodOrNull(one.getClass(), "equals", Object.class) != null) { return one.equals(another); } return objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(one)).equals( objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(another)) ); } JsonTypeDescriptor();  JsonTypeDescriptor(Type type);  JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper);  JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper, Type type); }
JsonTypeDescriptor extends AbstractTypeDescriptor<Object> implements DynamicParameterizedType { @Override public boolean areEqual(Object one, Object another) { if (one == another) { return true; } if (one == null || another == null) { return false; } if (one instanceof String && another instanceof String) { return one.equals(another); } if (one instanceof Collection && another instanceof Collection) { return Objects.equals(one, another); } if (one.getClass().equals(another.getClass()) && ReflectionUtils.getDeclaredMethodOrNull(one.getClass(), "equals", Object.class) != null) { return one.equals(another); } return objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(one)).equals( objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(another)) ); } JsonTypeDescriptor();  JsonTypeDescriptor(Type type);  JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper);  JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper, Type type); @Override void setParameterValues(Properties parameters); @Override boolean areEqual(Object one, Object another); @Override String toString(Object value); @Override Object fromString(String string); @SuppressWarnings({"unchecked"}) @Override X unwrap(Object value, Class<X> type, WrapperOptions options); @Override Object wrap(X value, WrapperOptions options); }
JsonTypeDescriptor extends AbstractTypeDescriptor<Object> implements DynamicParameterizedType { @Override public boolean areEqual(Object one, Object another) { if (one == another) { return true; } if (one == null || another == null) { return false; } if (one instanceof String && another instanceof String) { return one.equals(another); } if (one instanceof Collection && another instanceof Collection) { return Objects.equals(one, another); } if (one.getClass().equals(another.getClass()) && ReflectionUtils.getDeclaredMethodOrNull(one.getClass(), "equals", Object.class) != null) { return one.equals(another); } return objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(one)).equals( objectMapperWrapper.toJsonNode(objectMapperWrapper.toString(another)) ); } JsonTypeDescriptor();  JsonTypeDescriptor(Type type);  JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper);  JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper, Type type); @Override void setParameterValues(Properties parameters); @Override boolean areEqual(Object one, Object another); @Override String toString(Object value); @Override Object fromString(String string); @SuppressWarnings({"unchecked"}) @Override X unwrap(Object value, Class<X> type, WrapperOptions options); @Override Object wrap(X value, WrapperOptions options);  }