Package com.dtolabs.rundeck.core.plugins
Class VersionCompare
- java.lang.Object
-
- com.dtolabs.rundeck.core.plugins.VersionCompare
-
public class VersionCompare extends java.lang.Object
VersionCompare compares version strings for plugin files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VersionCompare.fileComparator
-
Constructor Summary
Constructors Constructor Description VersionCompare()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
atLeast(VersionCompare b)
Return true if this verison is at least as big as the given versionboolean
atMost(VersionCompare b)
Return true if this verison is at most as big as the given versionstatic int
comp(java.lang.Integer v1, java.lang.String s1, java.lang.Integer v2, java.lang.String s2)
Compares two version strings and their parsed integer values if available.int
compareTo(VersionCompare b)
static VersionCompare
forString(java.lang.String value)
Return a VersionCompare for the stringjava.lang.String
toString()
-
-
-
Method Detail
-
comp
public static int comp(java.lang.Integer v1, java.lang.String s1, java.lang.Integer v2, java.lang.String s2)
Compares two version strings and their parsed integer values if available. Returns -1,0 or 1, if value 1 is less than, equal to, or greater than value 2, respectively. Compares integers if both are available, otherwise compares non-integer as less than integer. if no integers are available, comparse strings, and treats null strings as less than non-null strings.
-
compareTo
public int compareTo(VersionCompare b)
-
atLeast
public boolean atLeast(VersionCompare b)
Return true if this verison is at least as big as the given version
-
atMost
public boolean atMost(VersionCompare b)
Return true if this verison is at most as big as the given version
-
forString
public static VersionCompare forString(java.lang.String value)
Return a VersionCompare for the string
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-