/*_############################################################################
  _## 
  _##  SNMP4J-AgentX - VersionInfo.java  
  _## 
  _##  Copyright (C) 2005-2026  Frank Fock (SNMP4J.org)
  _##  
  _##  This program is free software; you can redistribute it and/or modify
  _##  it under the terms of the GNU General Public License version 2 as 
  _##  published by the Free Software Foundation.
  _##
  _##  This program is distributed in the hope that it will be useful,
  _##  but WITHOUT ANY WARRANTY; without even the implied warranty of
  _##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  _##  GNU General Public License for more details.
  _##
  _##  You should have received a copy of the GNU General Public License
  _##  along with this program; if not, write to the Free Software
  _##  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
  _##  MA  02110-1301  USA
  _##  
  _##########################################################################*/

package org.snmp4j.agent.agentx.version;

/**
 * The {@code VersionInfo} object returns information about the version
 * of this SNMP4J-AgentX release.
 *
 * @author Frank Fock
 * @version 1.1
 * @since 1.1
 */
public class VersionInfo {

    /**
     * The major version number of this SNMP4J-AgentX release.
     */
    public static final int MAJOR = 4;
    /**
     * The minor version number of this SNMP4J-AgentX release.
     */
    public static final int MINOR = 2;
    /**
     * The update (patch level) version number of this SNMP4J-AgentX release.
     */
    public static final int UPDATE = 0;
    /**
     * An optional patch qualifier appended to the version string (empty if none).
     */
    public static final String PATCH = "";

    /**
     * The full version string of this SNMP4J-AgentX release in the form
     * {@code major.minor.update[patch]}.
     */
    public static final String VERSION =
            MAJOR + "." + MINOR + "." + UPDATE + PATCH;

    /**
     * The minimum required major version of the SNMP4J dependency.
     */
    public static final int DEPENDENCY_SNMP4J_MAJOR = 3;
    /**
     * The minimum required minor version of the SNMP4J dependency.
     */
    public static final int DEPENDENCY_SNMP4J_MINOR = 13;
    /**
     * The minimum required update version of the SNMP4J dependency.
     */
    public static final int DEPENDENCY_SNMP4J_UPDATE = 1;
    /**
     * The minimum required patch qualifier of the SNMP4J dependency.
     */
    public static final String DEPENDENCY_SNMP4J_PATCH = "";

    /**
     * The minimum required major version of the SNMP4J-Agent dependency.
     */
    public static final int DEPENDENCY_SNMP4J_AGENT_MAJOR = 3;
    /**
     * The minimum required minor version of the SNMP4J-Agent dependency.
     */
    public static final int DEPENDENCY_SNMP4J_AGENT_MINOR = 10;
    /**
     * The minimum required update version of the SNMP4J-Agent dependency.
     */
    public static final int DEPENDENCY_SNMP4J_AGENT_UPDATE = 1;
    /**
     * The minimum required patch qualifier of the SNMP4J-Agent dependency.
     */
    public static final String DEPENDENCY_SNMP4J_AGENT_PATCH = "";

    /**
     * The minimum required major version of the SNMP4J-Agent-DB dependency.
     */
    public static final int DEPENDENCY_SNMP4J_AGENT_DB_MAJOR = 3;
    /**
     * The minimum required minor version of the SNMP4J-Agent-DB dependency.
     */
    public static final int DEPENDENCY_SNMP4J_AGENT_DB_MINOR = 10;
    /**
     * The minimum required update version of the SNMP4J-Agent-DB dependency.
     */
    public static final int DEPENDENCY_SNMP4J_AGENT_DB_UPDATE = 1;
    /**
     * The minimum required patch qualifier of the SNMP4J-Agent-DB dependency.
     */
    public static final String DEPENDENCY_SNMP4J_AGENT_DB_PATCH = "";

    /**
     * Gets the version string for this release.
     *
     * @return a string of the form {@code major.minor.update[patch]}.
     */
    public static String getVersion() {
        return VERSION;
    }

    /**
     * Checks whether SNMP4J has the minimum required version.
     *
     * @return {@code true} if the dependencies have the minimum required
     * version(s).
     */
    public static boolean checkMinVersionOfDependencies() {
        return org.snmp4j.version.VersionInfo.MAJOR >= DEPENDENCY_SNMP4J_MAJOR
                && org.snmp4j.version.VersionInfo.MINOR >= DEPENDENCY_SNMP4J_MINOR
                && org.snmp4j.version.VersionInfo.UPDATE >= DEPENDENCY_SNMP4J_UPDATE
                && org.snmp4j.version.VersionInfo.PATCH.compareTo(DEPENDENCY_SNMP4J_PATCH) >= 0
                && org.snmp4j.agent.version.VersionInfo.MAJOR >= DEPENDENCY_SNMP4J_AGENT_MAJOR
                && org.snmp4j.agent.version.VersionInfo.MINOR >= DEPENDENCY_SNMP4J_AGENT_MINOR
                && org.snmp4j.agent.version.VersionInfo.UPDATE >= DEPENDENCY_SNMP4J_AGENT_UPDATE
                && org.snmp4j.agent.version.VersionInfo.PATCH.compareTo(DEPENDENCY_SNMP4J_AGENT_PATCH) >= 0
                && org.snmp4j.agent.db.version.VersionInfo.MAJOR >= DEPENDENCY_SNMP4J_AGENT_DB_MAJOR
                && org.snmp4j.agent.db.version.VersionInfo.MINOR >= DEPENDENCY_SNMP4J_AGENT_DB_MINOR
                && org.snmp4j.agent.db.version.VersionInfo.UPDATE >= DEPENDENCY_SNMP4J_AGENT_DB_UPDATE
                && org.snmp4j.agent.db.version.VersionInfo.PATCH.compareTo(DEPENDENCY_SNMP4J_AGENT_DB_PATCH) >= 0;
    }

    private VersionInfo() {
    }

}
