Package com.aoindustries.version
Class Version
- java.lang.Object
-
- com.aoindustries.version.Version
-
public final class Version extends Object
A software version consisting of four integer components.- Author:
- AO Industries, Inc.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetBuild()Gets the build number.static VersiongetInstance(int major, int minor, int release, int build)Gets a version number instance from its component parts.intgetMajor()Gets the major version number.intgetMinor()Gets the minor version number.intgetRelease()Gets the release number.inthashCode()StringtoString()The toString representation ismajor.minor.release.buildstatic VersionvalueOf(String version)Parses a version number from its string representation.
-
-
-
Method Detail
-
getInstance
public static Version getInstance(int major, int minor, int release, int build)
Gets a version number instance from its component parts.
-
valueOf
public static Version valueOf(String version) throws IllegalArgumentException
Parses a version number from its string representation.- Throws:
IllegalArgumentException- See Also:
toString()
-
toString
public String toString()
The toString representation ismajor.minor.release.build- Overrides:
toStringin classObject- See Also:
valueOf(String)
-
getMajor
public int getMajor()
Gets the major version number. A change in the first number means a radically new code base, complete uninstall/reinstall may be necessary.
-
getMinor
public int getMinor()
Gets the minor version number. A change in the second number means significant features have been added, but are generally compatible with previous versions. Update strongly recommended.
-
getRelease
public int getRelease()
Gets the release number. A change in the third number means fixes or improvements to existing features, but maintaining compatibility with current version. Update recommended.
-
getBuild
public int getBuild()
Gets the build number. A change in the build number only indicates minor fixes or improvements to existing features. Update not required or even suggested.
-
-