com.github.ferstl.maven.pomenforcers.artifact.ArtifactInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pedantic-pom-enforcers Show documentation
Show all versions of pedantic-pom-enforcers Show documentation
The Pedantic POM Enforcers consist of serveral Maven enforcer rules that help you keep your
project setup consistent and organized.
package com.github.ferstl.maven.pomenforcers.artifact;
import com.google.common.base.Equivalence;
public class ArtifactInfo {
private final String groupId;
private final String artifactId;
public ArtifactInfo(String groupId, String artifactId) {
this.groupId = groupId;
this.artifactId = artifactId;
}
public String getGroupId() {
return this.groupId;
}
public String getArtifactId() {
return this.artifactId;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ArtifactInfo) {
return new ArtifactInfoEquivalence().equivalent(this, (ArtifactInfo) obj);
}
return false;
}
@Override
public int hashCode() {
return new ArtifactInfoEquivalence().hash(this);
}
@Override
public String toString() {
return this.groupId + ":" + this.artifactId;
}
private class ArtifactInfoEquivalence extends Equivalence {
@Override
protected boolean doEquivalent(ArtifactInfo a, ArtifactInfo b) {
return a.groupId.equals(b.groupId) && a.artifactId.equals(b.artifactId);
}
@Override
protected int doHash(ArtifactInfo t) {
return (t.groupId + ":" + t.artifactId).hashCode();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy