AMashenkov commented on code in PR #6225:
URL: https://github.com/apache/ignite-3/pull/6225#discussion_r2199990907
##########
modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/framework/ConfigAnnotation.java:
##########
@@ -29,38 +32,53 @@ public class ConfigAnnotation {
@JsonProperty
private String name;
@JsonProperty
- private Map<String, String> properties;
+ private Map<String, ConfigAnnotationValue> properties = new
LinkedHashMap<>();
+ @SuppressWarnings("unused")
ConfigAnnotation() {
// Default constructor for Jackson deserialization.
}
- ConfigAnnotation(String name) {
- this(name, Map.of());
- }
-
- ConfigAnnotation(String name, Map<String, String> properties) {
+ ConfigAnnotation(String name, Map<String, ConfigAnnotationValue>
properties) {
this.name = name;
this.properties = properties;
}
- @Override
- public int hashCode() {
- return Objects.hashCode(name);
+ /**
+ * Returns annotation type name.
+ */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * Returns values of annotation properties.
+ */
+ public Map<String, ConfigAnnotationValue> properties() {
+ return properties;
}
@Override
public boolean equals(Object o) {
- // TODO https://issues.apache.org/jira/browse/IGNITE-25747 Validate
annotations properly.
- return o != null && getClass() == o.getClass() &&
name.equals(((ConfigAnnotation) o).name);
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ConfigAnnotation that = (ConfigAnnotation) o;
+ return Objects.equals(name, that.name) && Objects.equals(properties,
that.properties);
+ }
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, properties);
}
@Override
public String toString() {
+ // This method is used for metadata comparison,
+ // so we exclude values from the comparison.
Review Comment:
Let's add a separate method (if it is still actual) for this porpose, e.g.
`digest()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]