Sort the artifact dependency synonyms by main layout provider and then alphabetic order
Sonar: Added equals() and hashCode() implementations.
package org.carlspring.strongbox.dependency.snippet;
import javax.annotation.Nonnull;
+import java.util.Objects;
public class CodeSnippet
implements Comparable<CodeSnippet>
@@ -43,4 +44,28 @@ public class CodeSnippet
return name.compareTo(codeSnippet.getName());
}
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ CodeSnippet snippet = (CodeSnippet) o;
+
+ return Objects.equals(name, snippet.name) && Objects.equals(code, snippet.code);
+ }
+
+ @Override
+ public int hashCode()
+ {
+
+ return Objects.hash(name, code);
+ }
+
}
