info.magnolia.module.model.Version.getMajor()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(99)

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

Version.getMajor介绍

暂无

代码示例

代码示例来源:origin: info.magnolia/magnolia-core

/**
 * Compares major, minor and patch revisions of this Version against the given Version.
 * Classifier is ignored.
 */
public boolean isEquivalent(final Version other) {
  if (other == UNDEFINED_DEVELOPMENT_VERSION) {
    return true;
  }
  return this.getMajor() == other.getMajor() &&
      this.getMinor() == other.getMinor() &&
      this.getPatch() == other.getPatch();
}

代码示例来源:origin: info.magnolia/magnolia-core

public boolean isStrictlyAfter(final Version other) {
  if (isEquivalent(other)) {
    return false;
  }
  if (this.getMajor() != other.getMajor()) {
    return this.getMajor() > other.getMajor();
  }
  if (this.getMinor() != other.getMinor()) {
    return this.getMinor() > other.getMinor();
  }
  if (this.getPatch() != other.getPatch()) {
    return this.getPatch() > other.getPatch();
  }
  return false;
}

代码示例来源:origin: info.magnolia/magnolia-core

public static VersionMatcher version(String strVersion) {
  final Version version = Version.parseVersion(strVersion);
  return version().
      withMajor(equalTo(version.getMajor())).
      withMinor(equalTo(version.getMinor())).
      withPatch(equalTo(version.getPatch())).
      withClassifier(equalTo(version.getClassifier()));
}

代码示例来源:origin: info.magnolia/magnolia-core

public static void assertVersion(int expectedMajor, int expectedMinor, int expectedPatch, String expectedClassifier, Version actual) {
  assertEquals("major revision:", expectedMajor, actual.getMajor());
  assertEquals("minor revision:", expectedMinor, actual.getMinor());
  assertEquals("minor revision:", expectedPatch, actual.getPatch());
  assertEquals("classifier:", expectedClassifier, actual.getClassifier());
}

相关文章