All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.channelplugin.channel.ComparableMavenArtifact Maven / Gradle / Ivy

Go to download

This maven plugin overrides dependencies versions in a Maven project according to Wildfly channel definition.

There is a newer version: 1.0.19
Show newest version
package org.wildfly.channelplugin.channel;

import org.wildfly.channel.MavenArtifact;

/**
 * Extension of the MavenArtifact class which defines the `equals()` method.
 */
@Deprecated
public class ComparableMavenArtifact extends MavenArtifact {

    public ComparableMavenArtifact(MavenArtifact a) {
        super(a.getGroupId(), a.getArtifactId(), a.getExtension(), a.getClassifier(), a.getVersion(), a.getFile());
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof MavenArtifact) {
            MavenArtifact a = (MavenArtifact) obj;

            if (this.getClassifier() == null) {
                if (a.getClassifier() != null) {
                    return false;
                }
            } else if (!this.getClassifier().equals(a.getClassifier())) {
                return false;
            }

            return this.getGroupId().equals(a.getGroupId())
                    && this.getArtifactId().equals(a.getArtifactId())
                    && this.getExtension().equals(a.getExtension())
                    && this.getVersion().equals(a.getVersion());
        }
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy