com.github.zafarkhaja.semver.Version.getNormalVersion()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中com.github.zafarkhaja.semver.Version.getNormalVersion()方法的一些代码示例,展示了Version.getNormalVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getNormalVersion()方法的具体详情如下:
包路径:com.github.zafarkhaja.semver.Version
类名称:Version
方法名:getNormalVersion

Version.getNormalVersion介绍

[英]Returns the string representation of the normal version.
[中]返回正常版本的字符串表示形式。

代码示例

代码示例来源:origin: Graylog2/graylog2-server

/**
 * @see com.github.zafarkhaja.semver.Version#greaterThanOrEqualTo(com.github.zafarkhaja.semver.Version)
 */
public boolean sameOrHigher(Version other) {
  if (isNullOrEmpty(version.getPreReleaseVersion())) {
    return version.greaterThanOrEqualTo(other.getVersion());
  } else {
    // If this is a pre-release version, use the major.minor.patch version for comparison with the other.
    // This allows plugins to require a server version of 2.1.0 and it still gets loaded on a 2.1.0-beta.2 server.
    // See: https://github.com/Graylog2/graylog2-server/issues/2462
    return com.github.zafarkhaja.semver.Version.valueOf(version.getNormalVersion()).greaterThanOrEqualTo(other.getVersion());
  }
}

代码示例来源:origin: infiniteautomation/ma-core-public

public String getNormalVersion() {
  return version.getNormalVersion();
}

代码示例来源:origin: org.ajoberstar/semver-vcs-api

Scope(UnaryOperator<Version> incrementer) {
  this.versioner = (base, vcs) -> {
    Version prevVersion = vcs.getPreviousVersion().orElse(base);
    Version prevRelease = vcs.getPreviousRelease().orElse(base);
    Version incremented = incrementer.apply(prevRelease);
    if (incremented.getNormalVersion().equals(prevVersion.getNormalVersion())) {
      return prevVersion;
    } else {
      return incremented;
    }
  };
}

代码示例来源:origin: zafarkhaja/jsemver

/**
 * {@inheritDoc}
 */
@Override
public String toString() {
  StringBuilder sb = new StringBuilder(getNormalVersion());
  if (!getPreReleaseVersion().isEmpty()) {
    sb.append(PRE_RELEASE_PREFIX).append(getPreReleaseVersion());
  }
  if (!getBuildMetadata().isEmpty()) {
    sb.append(BUILD_PREFIX).append(getBuildMetadata());
  }
  return sb.toString();
}

代码示例来源:origin: com.github.zafarkhaja/java-semver

/**
 * {@inheritDoc}
 */
@Override
public String toString() {
  StringBuilder sb = new StringBuilder(getNormalVersion());
  if (!getPreReleaseVersion().isEmpty()) {
    sb.append(PRE_RELEASE_PREFIX).append(getPreReleaseVersion());
  }
  if (!getBuildMetadata().isEmpty()) {
    sb.append(BUILD_PREFIX).append(getBuildMetadata());
  }
  return sb.toString();
}

代码示例来源:origin: org.kurento/kurento-module-creator

/**
 * {@inheritDoc}.
 */
@Override
public String toString() {
 StringBuilder sb = new StringBuilder(getNormalVersion());
 if (!getPreReleaseVersion().isEmpty()) {
  sb.append(PRE_RELEASE_PREFIX).append(getPreReleaseVersion());
 }
 if (!getBuildMetadata().isEmpty()) {
  sb.append(BUILD_PREFIX).append(getBuildMetadata());
 }
 return sb.toString();
}

代码示例来源:origin: org.ajoberstar/semver-vcs-api

/**
 * Final stage will use only the normal version from the base
 * and remove all other information.
 * @return the final stage
 */
public static Stage finalStage() {
  return new Stage(FINAL_NAME, (base, vcs) -> Version.valueOf(base.getNormalVersion()));
}

代码示例来源:origin: org.ajoberstar/semver-vcs-api

private static Version sanitizeStage(Version inferred, String stage, boolean fixed) {
  String[] rawIdents = inferred.getPreReleaseVersion().split("\\.");
  int rawEndIndex = getEndIndex(rawIdents, 0);
  int limit;
  if (stage.equals(rawIdents[0])) {
    limit = 2;
  } else if (!fixed) {
    if (rawIdents.length > 2 && stage.equals(rawIdents[2])) {
      limit = 4;
    } else {
      limit = 2;
    }
  } else {
    return Version.valueOf(inferred.getNormalVersion());
  }
  int endIndex = Math.min(rawEndIndex, limit);
  String[] validIdents = Arrays.copyOfRange(rawIdents, 0, endIndex);
  String preRelease = String.join(".", validIdents);
  if (preRelease == null || preRelease.isEmpty()) {
    return inferred;
  } else {
    return inferred.setPreReleaseVersion(preRelease);
  }
}

代码示例来源:origin: org.graylog2/graylog2-server

/**
 * @see com.github.zafarkhaja.semver.Version#greaterThanOrEqualTo(com.github.zafarkhaja.semver.Version)
 */
public boolean sameOrHigher(Version other) {
  if (isNullOrEmpty(version.getPreReleaseVersion())) {
    return version.greaterThanOrEqualTo(other.getVersion());
  } else {
    // If this is a pre-release version, use the major.minor.patch version for comparison with the other.
    // This allows plugins to require a server version of 2.1.0 and it still gets loaded on a 2.1.0-beta.2 server.
    // See: https://github.com/Graylog2/graylog2-server/issues/2462
    return com.github.zafarkhaja.semver.Version.valueOf(version.getNormalVersion()).greaterThanOrEqualTo(other.getVersion());
  }
}

代码示例来源:origin: infiniteautomation/ma-core-public

Version version = Version.valueOf(mod.getValue());
String filename = ModuleUtils.moduleFilename(name, version.getNormalVersion());
String url = baseStoreUrl + "/"
    + ModuleUtils.downloadFilename(name, version.getNormalVersion());
HttpGet get = new HttpGet(url);

相关文章