public final class VersionUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VersionUtil.Version
class Version for compare
https://stackoverflow.com/questions/198431/how-do-you-compare-two-version-strings-in-java
|
| Constructor and Description |
|---|
VersionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
check(VersionUtil.Version version,
String begin,
String end,
String component)
Check whether a component version is matched expected range,
throw an exception if it's not matched.
|
static String |
getImplementationVersion(Class<?> clazz)
Get implementation version from manifest in jar
|
static String |
getImplementationVersion(String manifestPath) |
static String |
getPomVersion()
Get version from pom.xml
|
static boolean |
gte(String version,
String other)
Compare if a version is greater than the other one (inclusive)
|
static boolean |
match(VersionUtil.Version version,
String begin,
String end)
Compare if a version is inside a range [begin, end)
|
public static boolean match(VersionUtil.Version version, String begin, String end)
version - The version to be comparedbegin - The lower bound of the rangeend - The upper bound of the rangepublic static boolean gte(String version, String other)
version - The version to be comparedother - The lower bound of the rangepublic static void check(VersionUtil.Version version, String begin, String end, String component)
version - The version to be checkedbegin - The lower bound of the rangeend - The upper bound of the rangecomponent - The owner component of versionpublic static String getImplementationVersion(Class<?> clazz)
clazz - The class to be load from jar packagepublic static String getPomVersion()
Copyright © 2021. All rights reserved.