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

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

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

Version.isStrictlyAfter介绍

暂无

代码示例

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

public boolean isBeforeOrEquivalent(final Version other) {
  return !isStrictlyAfter(other);
}

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

/**
 * @param inputSpec the range as specified by the caller. Should not be used for actual validation, but can be used for error messages.
 */
private void validate(String inputSpec) {
  if (from.isStrictlyAfter(to)) {
    throw new IllegalArgumentException("Invalid range: " + from + " is not after " + to + " (specified as \"" + inputSpec + "\")");
  }
}

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

public boolean contains(Version other) {
  if (other.isEquivalent(from) && leftBoundary.include) {
    return true;
  }
  if (other.isEquivalent(to) && rightBoundary.include) {
    return true;
  }
  return other.isStrictlyAfter(from) && to.isStrictlyAfter(other);
}

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

@Override
  public int compare(Version v1, Version v2) {
    if (v1.isStrictlyAfter(v2)) {
      return 1;
    } else if (v1.isEquivalent(v2)) {
      return 0;
    } else {
      return -1;
    }
  }
}

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

protected List<Delta> getUpdateDeltas(InstallContext installContext, Version from) {
  final Version toVersion = installContext.getCurrentModuleDefinition().getVersion();
  final List<Delta> deltas = new LinkedList<>();
  for (Version v : allDeltas.keySet()) {
    if (v.isStrictlyAfter(toVersion)) {
      throw new IllegalArgumentException("Cannot handle delta for version '" + v.toString() + "' while only installing version '" + toVersion.toString() + "' of module '" + installContext.getCurrentModuleDefinition().getName() + "'.");
    }
    if (v.isStrictlyAfter(from)) {
      final Delta delta = allDeltas.get(v);
      if (v.isEquivalent(toVersion) && !StringUtils.equals(v.getClassifier(), toVersion.getClassifier())) {
        delta.getTasks().add(new ModuleVersionUpdateTask(toVersion));
      }
      deltas.add(delta);
    }
  }
  // if there was no delta for the version being installed, we still need to add the default update tasks
  if (toVersion.isStrictlyAfter(from) && !allDeltas.containsKey(toVersion)) {
    deltas.add(getDefaultUpdate(installContext));
  }
  return deltas;
}

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

private void doTestStrictlyAfter(boolean expected, String v1, String arg) {
  assertEquals(expected, Version.parseVersion(v1).isStrictlyAfter(Version.parseVersion(arg)));
}

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

@Test
public void testUndefinedDeveloperVersion() {
  Version realVersion = new Version(3, 1, 1);
  assertTrue(Version.parseVersion(Version.UndefinedDevelopmentVersion.KEY) instanceof UndefinedDevelopmentVersion);
  assertTrue(Version.UNDEFINED_DEVELOPMENT_VERSION.isEquivalent(realVersion));
  assertTrue(Version.UNDEFINED_DEVELOPMENT_VERSION.isBeforeOrEquivalent(realVersion));
  assertFalse(Version.UNDEFINED_DEVELOPMENT_VERSION.isStrictlyAfter(realVersion));
  assertTrue(realVersion.isEquivalent(Version.UNDEFINED_DEVELOPMENT_VERSION));
  assertTrue(realVersion.isBeforeOrEquivalent(Version.UNDEFINED_DEVELOPMENT_VERSION));
  assertFalse(realVersion.isStrictlyAfter(Version.UNDEFINED_DEVELOPMENT_VERSION));
  assertTrue(Version.UNDEFINED_DEVELOPMENT_VERSION.isEquivalent(Version.UNDEFINED_DEVELOPMENT_VERSION));
  assertTrue(Version.UNDEFINED_DEVELOPMENT_VERSION.isBeforeOrEquivalent(Version.UNDEFINED_DEVELOPMENT_VERSION));
  assertFalse(Version.UNDEFINED_DEVELOPMENT_VERSION.isStrictlyAfter(Version.UNDEFINED_DEVELOPMENT_VERSION));
}

相关文章