code: public static ScmConnector create(String scmType, String url, String privateKey, String username, String password, String branch, String tag) {
          ScmConnector scmConnector = null;
          if (StringUtils.isNotBlank(scmType)) {
              ScmType type = ScmType.getValue(scmType);
              if (type == null) {
                  throw new IllegalArgumentException("Invalid scm type, please select git / svn / mercurial");
              }
  
              if (StringUtils.isBlank(url)) {
                  throw new IllegalArgumentException("No scm link provided");
              }
  
              switch (type) {
                  case GIT:
                      scmConnector = new GitConnector(privateKey, username, password, url, branch, tag);
                      break;
                  case SVN:
                      scmConnector = new SvnConnector(username, password, url, branch, tag);
                      break;
                  case MERCURIAL:
                      scmConnector = new MercurialConnector(username, password, url, branch, tag);
                      break;
                  default: throw new IllegalArgumentException("Unsupported scm type");
              }
          }
          return scmConnector;
      }
docs: /* --- Static methods ---