Class VersionInfo

java.lang.Object
org.apache.sshd.common.util.VersionInfo
All Implemented Interfaces:
Serializable, Comparable<VersionInfo>

public class VersionInfo extends Object implements Serializable, Comparable<VersionInfo>
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • majorVersion

      private final int majorVersion
    • minorVersion

      private final int minorVersion
    • release

      private final int release
    • buildNumber

      private final int buildNumber
  • Constructor Details

    • VersionInfo

      public VersionInfo(int major, int minor)
    • VersionInfo

      public VersionInfo(int major, int minor, int release, int build)
  • Method Details

    • getMajorVersion

      public final int getMajorVersion()
    • getMinorVersion

      public final int getMinorVersion()
    • getRelease

      public final int getRelease()
    • getBuildNumber

      public final int getBuildNumber()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(VersionInfo o)
      Specified by:
      compareTo in interface Comparable<VersionInfo>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parse

      public static VersionInfo parse(String version) throws NumberFormatException
      Parses a version string - assumed to contain at most 4 non-negative components separated by a '.'. If less than 4 components are found, then the rest are assumed to be zero. If more than 4 components found, then only the 1st ones are parsed.
      Parameters:
      version - The version string - ignored if null/empty
      Returns:
      The parsed VersionInfo - or null if empty input
      Throws:
      NumberFormatException - If failed to parse any of the components
      IllegalArgumentException - If any of the parsed components is negative