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

io.github.chains_project.maven_lockfile.data.Environment Maven / Gradle / Ivy

Go to download

This plugin is a state-of-the-art solution that can be used to validate the integrity of a maven repository. It does this by generating a lock file that contains the checksums of all the artifacts in the repository. The lock file can then be used to validate the integrity of the repository. This guards the supply chain against malicious actors that might tamper with the artifacts in the repository.

There is a newer version: 5.3.5
Show newest version
package io.github.chains_project.maven_lockfile.data;

import java.util.Objects;

/**
 * Metadata about the environment in which the lock file was generated. This includes the OS name, the Maven version and the Java version.
 */
public class Environment {

    private final String osName;
    private final String mavenVersion;
    private final String javaVersion;

    public Environment(String osName, String mavenVersion, String javaVersion) {
        this.osName = osName;
        this.mavenVersion = mavenVersion;
        this.javaVersion = javaVersion;
    }

    /**
     * @return the java version of the environment in which the lock file was generated
     */
    public String getJavaVersion() {
        return javaVersion;
    }
    /**
     * @return the mavenVersion of the environment in which the lock file was generated
     */
    public String getMavenVersion() {
        return mavenVersion;
    }
    /**
     * @return the osName of the environment in which the lock file was generated
     */
    public String getOsName() {
        return osName;
    }

    @Override
    public String toString() {
        return "Metadata [osName=" + osName + ", mavenVersion=" + mavenVersion + ", javaVersion=" + javaVersion + "]";
    }

    @Override
    public int hashCode() {
        return Objects.hash(osName, mavenVersion, javaVersion);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Environment)) {
            return false;
        }
        Environment other = (Environment) obj;
        return Objects.equals(osName, other.osName)
                && Objects.equals(mavenVersion, other.mavenVersion)
                && Objects.equals(javaVersion, other.javaVersion);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy