Class VersionConverter


  • public class VersionConverter
    extends java.lang.Object
    Converts generic version identifiers to the Version instances.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Version toOsgiVersion​(java.lang.String value)
      Converts generic version id to the Version instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VersionConverter

        public VersionConverter()
    • Method Detail

      • toOsgiVersion

        public static Version toOsgiVersion​(java.lang.String value)
                                     throws java.lang.IllegalArgumentException
        Converts generic version id to the Version instance. Examples:
         0.0 -> 0.0.0
         2.3.4-SNAPSHOT -> 2.3.4.SNAPSHOT
         8.7.6-special-edition -> 8.7.6.special-edition
         
        Parameters:
        value - any usual version id parseable by the Version class constructor after adding missing implicit values.
        Returns:
        Version
        Throws:
        java.lang.IllegalArgumentException - If the numerical components are negative or the qualifier string is invalid.