@Test public void testEquals() { assertEquals(field, fieldSame); assertEquals(field, fieldComment); assertEquals(fieldSame, fieldComment); assertNotEquals(field, fieldKey); assertNotEquals(field, fieldRequired); assertNotEquals(field, fieldName); assertNotEquals(field, fieldType); assertNotEquals(field, fieldDefault); assertNotEquals(field, fieldNoDefault); assertNotEquals(fieldSame, fieldKey); assertNotEquals(fieldSame, fieldRequired); assertNotEquals(fieldSame, fieldName); assertNotEquals(fieldSame, fieldType); assertNotEquals(fieldSame, fieldDefault); assertNotEquals(fieldSame, fieldNoDefault); assertNotEquals(fieldComment, fieldKey); assertNotEquals(fieldComment, fieldRequired); assertNotEquals(fieldComment, fieldName); assertNotEquals(fieldComment, fieldType); assertNotEquals(fieldComment, fieldDefault); assertNotEquals(fieldComment, fieldNoDefault); assertNotEquals(fieldKey, fieldRequired); assertNotEquals(fieldKey, fieldName); assertNotEquals(fieldKey, fieldType); assertNotEquals(fieldKey, fieldDefault); assertNotEquals(fieldKey, fieldNoDefault); assertNotEquals(fieldRequired, fieldName); assertNotEquals(fieldRequired, fieldType); assertNotEquals(fieldRequired, fieldDefault); assertNotEquals(fieldRequired, fieldNoDefault); assertNotEquals(fieldName, fieldType); assertNotEquals(fieldName, fieldDefault); assertNotEquals(fieldName, fieldNoDefault); assertNotEquals(fieldType, fieldDefault); assertNotEquals(fieldType, fieldNoDefault); assertNotEquals(fieldDefault, fieldNoDefault); fieldComment = new CField(null, 4, PRequirement.DEFAULT, "name", PPrimitive.I32.provider(), new PDefaultValueProvider<>(4), null); assertEquals(fieldComment, field); assertEquals(fieldComment, fieldSame); }
@Override public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof CField)) { return false; } CField other = (CField) o; return id == other.id && requirement == other.requirement && equalsQualifiedName(getDescriptor(), other.getDescriptor()) && name.equals(other.name) && Objects.equals(defaultValue, other.defaultValue); }
CField implements PField, CAnnotatedDescriptor { @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof CField)) { return false; } CField other = (CField) o; return id == other.id && requirement == other.requirement && equalsQualifiedName(getDescriptor(), other.getDescriptor()) && name.equals(other.name) && Objects.equals(defaultValue, other.defaultValue); } }
CField implements PField, CAnnotatedDescriptor { @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof CField)) { return false; } CField other = (CField) o; return id == other.id && requirement == other.requirement && equalsQualifiedName(getDescriptor(), other.getDescriptor()) && name.equals(other.name) && Objects.equals(defaultValue, other.defaultValue); } CField(@Nullable String docs,
                  int id,
                  @Nonnull PRequirement requirement,
                  @Nonnull String name,
                  @Nonnull PDescriptorProvider typeProvider,
                  @Nullable PValueProvider defaultValue,
                  @Nullable Map<String, String> annotations); }
CField implements PField, CAnnotatedDescriptor { @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof CField)) { return false; } CField other = (CField) o; return id == other.id && requirement == other.requirement && equalsQualifiedName(getDescriptor(), other.getDescriptor()) && name.equals(other.name) && Objects.equals(defaultValue, other.defaultValue); } CField(@Nullable String docs,
                  int id,
                  @Nonnull PRequirement requirement,
                  @Nonnull String name,
                  @Nonnull PDescriptorProvider typeProvider,
                  @Nullable PValueProvider defaultValue,
                  @Nullable Map<String, String> annotations); @Override String getDocumentation(); @Override int getId(); @Nonnull @Override PRequirement getRequirement(); @Nonnull @Override PType getType(); @Nonnull @Override PDescriptor getDescriptor(); @Nonnull @Override String getName(); @Override boolean hasDefaultValue(); @Override Object getDefaultValue(); @Nonnull @Override @SuppressWarnings("unchecked") Set<String> getAnnotations(); @Override boolean hasAnnotation(@Nonnull String name); @Override String getAnnotationValue(@Nonnull String name); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
CField implements PField, CAnnotatedDescriptor { @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof CField)) { return false; } CField other = (CField) o; return id == other.id && requirement == other.requirement && equalsQualifiedName(getDescriptor(), other.getDescriptor()) && name.equals(other.name) && Objects.equals(defaultValue, other.defaultValue); } CField(@Nullable String docs,
                  int id,
                  @Nonnull PRequirement requirement,
                  @Nonnull String name,
                  @Nonnull PDescriptorProvider typeProvider,
                  @Nullable PValueProvider defaultValue,
                  @Nullable Map<String, String> annotations); @Override String getDocumentation(); @Override int getId(); @Nonnull @Override PRequirement getRequirement(); @Nonnull @Override PType getType(); @Nonnull @Override PDescriptor getDescriptor(); @Nonnull @Override String getName(); @Override boolean hasDefaultValue(); @Override Object getDefaultValue(); @Nonnull @Override @SuppressWarnings("unchecked") Set<String> getAnnotations(); @Override boolean hasAnnotation(@Nonnull String name); @Override String getAnnotationValue(@Nonnull String name); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }