Package org.apache.sshd.common.util
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>
- Author:
- Apache MINA SSHD Project
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VersionInfo(int major, int minor)VersionInfo(int major, int minor, int release, int build)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(VersionInfo o)booleanequals(Object obj)intgetBuildNumber()intgetMajorVersion()intgetMinorVersion()intgetRelease()inthashCode()static VersionInfoparse(String version)Parses a version string - assumed to contain at most 4 non-negative components separated by a '.'.StringtoString()
-
-
-
Method Detail
-
getMajorVersion
public final int getMajorVersion()
-
getMinorVersion
public final int getMinorVersion()
-
getRelease
public final int getRelease()
-
getBuildNumber
public final int getBuildNumber()
-
compareTo
public int compareTo(VersionInfo o)
- Specified by:
compareToin interfaceComparable<VersionInfo>
-
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 ifnull/empty- Returns:
- The parsed
VersionInfo- ornullif empty input - Throws:
NumberFormatException- If failed to parse any of the componentsIllegalArgumentException- If any of the parsed components is negative
-
-