Package com.blueriq.component.api.plugin
Class PluginVersion
java.lang.Object
com.blueriq.component.api.plugin.PluginVersion
- All Implemented Interfaces:
Serializable
Plugin version class for releases and snapshots.
- Since:
- 8.0
- Author:
- Danny Roest
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic PluginVersion
createVersionFromString
(String artifactVersion, String buildNumber) boolean
This method returns the branch.long
This method returns the build number set by Hudson.int
getMajor()
This method returns the major number.int
getMinor()
This method returns the minor number.getPatch()
This method returns the patch (only for release version).This method returns the string representation of this version.int
hashCode()
boolean
This method returns true if this version is a snapshot.toString()
static PluginVersion
valueOfProperties
(Properties properties) This method constructs a PluginVersion based on the specified properties.static PluginVersion
valueOfRelease
(int major, int minor) This method creates a new Release Plugin version without a patch.static PluginVersion
valueOfRelease
(int major, int minor, String patch) This method creates a new Release Plugin version with a patch.static PluginVersion
valueOfSnapshot
(int major, int minor, long buildNumber) This method creates a new Snapshot Plugin version with a build number.static PluginVersion
valueOfSnapshot
(int major, int minor, String branch, long buildNumber) This method creates a new Snapshot Plugin version with a build number.static PluginVersion
valueOfSnapshot
(int major, long buildNumber) This method creates a new Snapshot Plugin version with a build number.static PluginVersion
valueOfSnapshot
(int major, String branch, long buildNumber) This method creates a new Snapshot Plugin version with a build number.
-
Method Details
-
valueOfRelease
This method creates a new Release Plugin version with a patch.- Parameters:
major
- the major numberminor
- the minor numberpatch
- the patch of this version- Returns:
- a Plugin version
-
valueOfRelease
This method creates a new Release Plugin version without a patch.- Parameters:
major
- the major numberminor
- the minor number- Returns:
- a Plugin version
-
valueOfSnapshot
This method creates a new Snapshot Plugin version with a build number.- Parameters:
major
- the major numberbranch
- the branch namebuildNumber
- the buildNumber- Returns:
- a Plugin version
-
valueOfSnapshot
This method creates a new Snapshot Plugin version with a build number.- Parameters:
major
- the major numberbuildNumber
- the buildNumber- Returns:
- a Plugin version
-
valueOfSnapshot
This method creates a new Snapshot Plugin version with a build number.- Parameters:
major
- the major numberminor
- the minor numberbranch
- the branch namebuildNumber
- the buildNumber- Returns:
- a Plugin version
-
valueOfSnapshot
This method creates a new Snapshot Plugin version with a build number.- Parameters:
major
- the major numberminor
- the minor numberbuildNumber
- the buildNumber- Returns:
- a Plugin version
-
valueOfProperties
This method constructs a PluginVersion based on the specified properties.Examples of possible content of 'plugin-version.properties':
Example 1: artifact-version=8.1 build-number=300 Example 2: artifact-version=8-SNAPSHOT build-number=123
Note: Build number is only used for snapshots.
- Parameters:
properties
- the properties containing the version information- Returns:
- the plugin version constructed from the properties files.
-
createVersionFromString
-
isSnapshot
public boolean isSnapshot()This method returns true if this version is a snapshot. If the version is not a snapshot, it is considered a release.- Returns:
- true is this version is a snapshot
-
getMajor
public int getMajor()This method returns the major number.- Returns:
- the major number
-
getMinor
public int getMinor()This method returns the minor number.- Returns:
- the minor number (-1 if this version has no minor number)
-
getBuildNumber
public long getBuildNumber()This method returns the build number set by Hudson.- Returns:
- the buildnumber (-1 if this version has no build number)
-
getBranch
This method returns the branch.- Returns:
- the branch name (can be null)
-
getPatch
This method returns the patch (only for release version).- Returns:
- the patch (can be null)
-
getString
This method returns the string representation of this version.- Returns:
- the string representation of this version.
-
toString
-
hashCode
public int hashCode() -
equals
-