java.lang.Object
ch.qos.logback.core.util.VersionUtil
Utility class for handling and validating version information of various artifacts.
It is used by logback-classic, logback-access-common, logback-access-jetty11, logback-access-tomcat, etc. to alert users about version discrepancies between dependent and dependee artifacts.
- Since:
- 1.5.25
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckForVersionEquality(Context context, Class<?> dependentClass, Class<?> dependeeClass, String dependentName, String dependeeName) static voidcompareExpectedAndFoundVersion(Context context, Class<?> dependentClass, Class<?> dependeeClass, String dependentName, String dependeeName) static StringgetVersionOfArtifact(Class<?> aClass) Retrieves the version of an artifact, such as logback-core.jar, logback-access-common.jar etc.static String
-
Constructor Details
-
VersionUtil
public VersionUtil()
-
-
Method Details
-
getVersionOfArtifact
Retrieves the version of an artifact, such as logback-core.jar, logback-access-common.jar etc.The aClass parameter is assumed to be part of the artifact.
The method first attempts to get the version from the module information. If the module version is not available, it falls back to retrieving the implementation version from the package.
- Parameters:
aClass- the class from which to retrieve the version information- Returns:
- the version of the artifact where aClass is found, or null if the version cannot be determined
- Since:
- 2.0.9
-
nonNull
-
checkForVersionEquality
-
compareExpectedAndFoundVersion
-