/*_############################################################################
  _## 
  _##  SNMP4J-Agent-DB 3 - VersionInfo.java  
  _## 
  _##  Copyright (C) 2017-2025 Frank Fock (SNMP4J.org)
  _##  
  _##  Licensed under the Apache License, Version 2.0 (the "License");
  _##  you may not use this file except in compliance with the License.
  _##  You may obtain a copy of the License at
  _##  
  _##      http://www.apache.org/licenses/LICENSE-2.0
  _##  
  _##  Unless required by applicable law or agreed to in writing, software
  _##  distributed under the License is distributed on an "AS IS" BASIS,
  _##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  _##  See the License for the specific language governing permissions and
  _##  limitations under the License.
  _##  
  _##########################################################################*/

package org.snmp4j.agent.db.version;

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

    /** The major version number of this SNMP4J-Agent-DB release. */
    public static final int MAJOR = 3;
    /** The minor version number of this SNMP4J-Agent-DB release. */
    public static final int MINOR = 10;
    /** The update (micro) version number of this SNMP4J-Agent-DB release. */
    public static final int UPDATE = 1;
    /** The optional patch suffix of this SNMP4J-Agent-DB release. */
    public static final String PATCH = "";

    /** The full version string of this SNMP4J-Agent-DB release. */
    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 suffix 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 suffix of the SNMP4J-Agent dependency. */
    public static final String DEPENDENCY_SNMP4J_AGENT_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 all dependencies have 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;
    }

    private VersionInfo() {
    }

}
