Interface Version

All Superinterfaces:
Comparable<Version>

public interface Version extends Comparable<Version>
Specifies a version and serves as a factory for Version.Builder instances.
  • Field Details

  • 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

      Optional<String> metadata()
      Returns:
      the metadata part of this version or an empty Optional in case of no metadata
    • build

      Optional<String> build()
      Returns:
      the build information part of this version or an empty Optional in case of no build information
    • builder

      static Version.Builder builder()
      Returns:
      a new Version.Builder instance.
    • versionString

      static String versionString()
      Returns:
      a string containing the framework version number, without any version metadata (fx. build no.)
    • versionAndMetadataString

      static String versionAndMetadataString()
      Returns:
      a string containing the framework version and version metadata
    • version

      static Version version()
      Returns:
      the framework Version
    • parse

      static Version parse(String versionString)
      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

      static Version parse(Class<?> resourceOwner, String versionFileResourcePath)
      Reads a properties file from the classpath and parses the value associated with the 'version' key.
      Parameters:
      resourceOwner - the resource owning class
      versionFileResourcePath - 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