code: public static Version parse(String version) {
          if (version == null) {
              throw new NullPointerException("version is null");
          }
          Version result = new Version();
          String[] numbers = version.split(".");
          for (int i = 0; i < numbers.length; i++) {
              String parts[] = numbers[i].split("-");
              int number = Integer.parseInt(parts[0]);
              StringBuilder label = new StringBuilder();
              for (int j = 1; j < parts.length; j++) {
                  if ((i < numbers.length - 1) && (j < parts.length - 1)){
                      label.append('-').append(parts[j]);
                  } else {
                      result.setSnapshot(parts[j].equalsIgnoreCase("SNAPSHOT"));
                  }
              }
              result.append(number, label.toString());
          }
          return result;
      }
docs: Creates a new version descriptor based on its string presentation.
  
  @param version string presentation of a version.
  @return version descriptor.
  @throws RuntimeException if error occurs while parsing the version.
  
  @since v1.1.0