- All Superinterfaces:
Comparable<Version>
Specifies a version and serves as a factory for
Version.Builder
instances.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The key for a version property in a properties file. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
static Version.Builder
builder()
int
major()
metadata()
int
minor()
static Version
Reads a properties file from the classpath and parses the value associated with the 'version' key.static Version
Parses a string on the form x.y.z-metadata+buildint
patch()
static Version
version()
static String
static String
Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
VERSION_PROPERTY_KEY
The key for a version property in a properties file.- See Also:
-
-
Method Details
-
major
int major()- Returns:
- the major part of this version
-
minor
int minor()- Returns:
- the minor part of this version
-
patch
int patch()- Returns:
- the patch part of this version
-
metadata
- Returns:
- the metadata part of this version or an empty Optional in case of no metadata
-
build
- Returns:
- the build information part of this version or an empty Optional in case of no build information
-
builder
- Returns:
- a new
Version.Builder
instance.
-
versionString
- Returns:
- a string containing the framework version number, without any version metadata (fx. build no.)
-
versionAndMetadataString
- Returns:
- a string containing the framework version and version metadata
-
version
- Returns:
- the framework Version
-
parse
Parses a string on the form x.y.z-metadata+build- Parameters:
versionString
- the version string- Returns:
- a Version based on the given string
-
parse
Reads a properties file from the classpath and parses the value associated with the 'version' key.- Parameters:
resourceOwner
- the resource owning classversionFileResourcePath
- the resource path to the file containing the version, prefix with '/' for classpath root- Returns:
- a
Version
instance parsed from the value associated with the 'version' property key found in the given resource - Throws:
IllegalArgumentException
- in case the properties resource is not found or if no 'version' property key is found
-