public final class Version extends Object
This class retrieves the version information from
META-INF/com.linecorp.armeria.versions.properties, which is generated in build time. Note that
it may not be possible to retrieve the information completely, depending on your environment, such as
the specified ClassLoader, the current SecurityManager.
| Modifier and Type | Method and Description |
|---|---|
String |
artifactId()
Returns the Maven artifact ID of the component, such as
"armeria-grpc". |
String |
artifactVersion()
Returns the Maven artifact version of the component, such as
"1.0.0". |
long |
commitTimeMillis()
Returns when the release commit was created.
|
static Version |
get(String artifactId)
Returns the version information for the Armeria artifact named
artifactId. |
static Version |
get(String artifactId,
ClassLoader classLoader)
Returns the version information for the Armeria artifact named
artifactId using the specified
ClassLoader. |
static Map<String,Version> |
getAll()
Retrieves the version information of Armeria artifacts.
|
static Map<String,Version> |
getAll(ClassLoader classLoader)
Retrieves the version information of Armeria artifacts using the specified
ClassLoader. |
static Map<String,Version> |
identify()
Deprecated.
Use
getAll(). |
static Map<String,Version> |
identify(ClassLoader classLoader)
Deprecated.
Use
getAll(ClassLoader). |
boolean |
isClean()
Deprecated.
Use
isRepositoryClean(). |
boolean |
isRepositoryClean()
Returns whether the repository was clean when performing the release process.
|
String |
longCommitHash()
Returns the long hash of the release commit.
|
String |
repositoryStatus()
Returns the status of the repository when performing the release process.
|
String |
shortCommitHash()
Returns the short hash of the release commit.
|
String |
toString() |
public static Version get(String artifactId)
artifactId. If information for
the artifact can't be found, a default value is returned with arbitrary unknown values.public static Version get(String artifactId, ClassLoader classLoader)
artifactId using the specified
ClassLoader. If information for the artifact can't be found, a default value is returned
with arbitrary unknown values.public static Map<String,Version> getAll()
identify(Version.class.getClassLoader()).public static Map<String,Version> getAll(ClassLoader classLoader)
ClassLoader.@Deprecated public static Map<String,Version> identify()
getAll().identify(Version.class.getClassLoader()).@Deprecated public static Map<String,Version> identify(ClassLoader classLoader)
getAll(ClassLoader).ClassLoader.public String artifactId()
"armeria-grpc".public String artifactVersion()
"1.0.0".public long commitTimeMillis()
public String shortCommitHash()
public String longCommitHash()
public String repositoryStatus()
"clean" if the repository was clean. "dirty" otherwise.@Deprecated public boolean isClean()
isRepositoryClean()."clean".equals(repositoryStatus()).public boolean isRepositoryClean()
"clean".equals(repositoryStatus()).Copyright © 2020 LeanCloud. All rights reserved.