Class VersionInfo

java.lang.Object
io.aiven.commons.system.VersionInfo

public final class VersionInfo extends Object
This class was originally developed by the Apache RAT project A formatter for Package information about a class.
See Also:
  • Constructor Details

    • VersionInfo

      public VersionInfo()
      Constructor that uses the VersionInfo package for information.
    • VersionInfo

      public VersionInfo(Class<?> clazz)
      Constructor for a specific class.
      Parameters:
      clazz - the class to get the Package information from.
  • Method Details

    • toString

      public String toString()
      Default string representation of the implementation information from the package.
      Overrides:
      toString in class Object
      Returns:
      The string representation.
    • getVersion

      public String getVersion()
      Gets the implementation version of the package. Will return "VERSION-NUMBER" if package information is not available.
      Returns:
      the implementation version.
    • getVendor

      public String getVendor()
      Gets the implementation vendor of the package. Will return "VENDOR-NAME" if package information is not available.
      Returns:
      the implementation vendor
    • getTitle

      public String getTitle()
      Gets the implementation title of the package. Will return "TITLE" if package information is not available.
      Returns:
      the implementation title
    • getSpecVersion

      public String getSpecVersion()
      Gets the specification version of the package. Will return "SPEC-VERSION" if package information is not available.
      Returns:
      the specification version.
    • getSpecVendor

      public String getSpecVendor()
      Gets the specification vendor of the package. Will return "SPEC-VENDOR" if package information is not available.
      Returns:
      the specification vendor
    • getSpecTitle

      public String getSpecTitle()
      Gets the specification title of the package. Will return "SPEC-TITLE" if package information is not available.
      Returns:
      the specification title
    • main

      public static void main(String[] args) throws ClassNotFoundException
      Main class to print version information.

      If specified the arguments are assumed to be class names and the Version info for each class printed. If not specified the version info for this class is printed.

      Parameters:
      args - the optional class names.
      Throws:
      ClassNotFoundException - if a clas name can not be resolved.