Package com.avoka.fc.core.util
Class ComposerReleaseComparator
- java.lang.Object
-
- com.avoka.fc.core.util.ComposerReleaseComparator
-
- All Implemented Interfaces:
Comparator<String>
public class ComposerReleaseComparator extends Object implements Comparator<String>
Provides a comparator for Composer versions- Since:
- 4.3.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
RELEASE_220
The 2.2.0 versionstatic String
RELEASE_330
The 3.3.0 versionstatic String
RELEASE_330SP1
The 3.3.0sp1 versionstatic String
RELEASE_330SP2
The 3.3.0sp2 versionstatic String
RELEASE_330SP3
The 3.3.0sp3 versionstatic String
RELEASE_330SP4
The 3.3.0sp4 versionstatic String
RELEASE_340
The 3.4.0 versionstatic String
RELEASE_340sp1
The 3.4.0sp1 versionstatic String
RELEASE_341
The 3.4.1 versionstatic String
RELEASE_341sp1
The 3.4.1sp1 versionstatic String
RELEASE_360
The 3.6.0 versionstatic String
RELEASE_400
The 4.0.0 versionstatic String
RELEASE_400sp1
The 4.0.0sp1 versionstatic String
RELEASE_410
The 4.1.0 versionstatic String
RELEASE_410sp1
The 4.1.0sp1 versionstatic String
RELEASE_420
The 4.2.0 versionstatic String
RELEASE_420sp1
The 4.2.0sp1 versionstatic String
RELEASE_430
The 4.3.0 versionstatic String
RELEASE_500
The 5.0.0 version
-
Constructor Summary
Constructors Constructor Description ComposerReleaseComparator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(String o1, String o2)
Compares two release strings.static boolean
isEqual(String source, String target)
Check whether a source version is equal to a target versionstatic boolean
isGreaterThan(String source, String target)
Check whether a source version is greater than a target versionstatic boolean
isGreaterThanOrEqual(String source, String target)
Check whether a source version is greater than or equal to a target versionstatic boolean
isLessThan(String source, String target)
Check whether a source version is less than a target versionstatic boolean
isLessThanOrEqual(String source, String target)
Check whether a source version is less than or equal to a target version-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
RELEASE_220
public static final String RELEASE_220
The 2.2.0 version- See Also:
- Constant Field Values
-
RELEASE_330
public static final String RELEASE_330
The 3.3.0 version- See Also:
- Constant Field Values
-
RELEASE_330SP1
public static final String RELEASE_330SP1
The 3.3.0sp1 version- See Also:
- Constant Field Values
-
RELEASE_330SP2
public static final String RELEASE_330SP2
The 3.3.0sp2 version- See Also:
- Constant Field Values
-
RELEASE_330SP3
public static final String RELEASE_330SP3
The 3.3.0sp3 version- See Also:
- Constant Field Values
-
RELEASE_330SP4
public static final String RELEASE_330SP4
The 3.3.0sp4 version- See Also:
- Constant Field Values
-
RELEASE_340
public static final String RELEASE_340
The 3.4.0 version- See Also:
- Constant Field Values
-
RELEASE_340sp1
public static final String RELEASE_340sp1
The 3.4.0sp1 version- See Also:
- Constant Field Values
-
RELEASE_341
public static final String RELEASE_341
The 3.4.1 version- See Also:
- Constant Field Values
-
RELEASE_341sp1
public static final String RELEASE_341sp1
The 3.4.1sp1 version- See Also:
- Constant Field Values
-
RELEASE_360
public static final String RELEASE_360
The 3.6.0 version- See Also:
- Constant Field Values
-
RELEASE_400
public static final String RELEASE_400
The 4.0.0 version- See Also:
- Constant Field Values
-
RELEASE_400sp1
public static final String RELEASE_400sp1
The 4.0.0sp1 version- See Also:
- Constant Field Values
-
RELEASE_410
public static final String RELEASE_410
The 4.1.0 version- See Also:
- Constant Field Values
-
RELEASE_410sp1
public static final String RELEASE_410sp1
The 4.1.0sp1 version- See Also:
- Constant Field Values
-
RELEASE_420
public static final String RELEASE_420
The 4.2.0 version- See Also:
- Constant Field Values
-
RELEASE_420sp1
public static final String RELEASE_420sp1
The 4.2.0sp1 version- See Also:
- Constant Field Values
-
RELEASE_430
public static final String RELEASE_430
The 4.3.0 version- See Also:
- Constant Field Values
-
RELEASE_500
public static final String RELEASE_500
The 5.0.0 version- See Also:
- Constant Field Values
-
-
Method Detail
-
compare
public int compare(String o1, String o2)
Compares two release strings. Release strings are of the form x.y.zsp# where the various components are optional. eg. Some examples are 3.2, 3.4.0, 4.0.0sp3- Specified by:
compare
in interfaceComparator<String>
- Parameters:
o1
- the first version stringo2
- the second version string- Returns:
- the result of the comparison
-
isLessThan
public static boolean isLessThan(String source, String target)
Check whether a source version is less than a target version- Parameters:
source
- the source versiontarget
- the target version- Returns:
- true if the source version is strictly less than the target version
-
isLessThanOrEqual
public static boolean isLessThanOrEqual(String source, String target)
Check whether a source version is less than or equal to a target version- Parameters:
source
- the source versiontarget
- the target version- Returns:
- true if the source version is less than or equal to the target version
-
isEqual
public static boolean isEqual(String source, String target)
Check whether a source version is equal to a target version- Parameters:
source
- the source versiontarget
- the target version- Returns:
- true if the source version is equal to the target version
-
isGreaterThan
public static boolean isGreaterThan(String source, String target)
Check whether a source version is greater than a target version- Parameters:
source
- the source versiontarget
- the target version- Returns:
- true if the source version is strictly greater than the target version
-
isGreaterThanOrEqual
public static boolean isGreaterThanOrEqual(String source, String target)
Check whether a source version is greater than or equal to a target version- Parameters:
source
- the source versiontarget
- the target version- Returns:
- true if the source version is greater than or equal to the target version
-
-