org.identityconnectors.common.Version.compareTo()方法的使用及代码示例

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

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

Version.compareTo介绍

暂无

代码示例

代码示例来源:origin: org.connid/framework

@Override
public boolean equals(Object o) {
  if (o instanceof Version) {
    return compareTo((Version) o) == 0;
  }
  return false;
}

代码示例来源:origin: net.tirasa.connid/connector-framework

@Override
public boolean equals(Object o) {
  if (o instanceof Version) {
    return compareTo((Version) o) == 0;
  }
  return false;
}

代码示例来源:origin: net.tirasa.connid/connector-framework

public boolean isInRange(Version version) {
  if (empty) {
    return false;
  }
  if (floorVersion.compareTo(version) >= (isFloorInclusive ? 1 : 0)) {
    return false;
  }
  if (ceilingVersion == null) {
    return true;
  }
  return ceilingVersion.compareTo(version) >= (isCeilingInclusive ? 0 : 1);
}

代码示例来源:origin: Tirasa/ConnId

@Override
public boolean equals(Object o) {
  if (o instanceof Version) {
    return compareTo((Version) o) == 0;
  }
  return false;
}

代码示例来源:origin: Tirasa/ConnId

public boolean isInRange(Version version) {
  if (empty) {
    return false;
  }
  if (floorVersion.compareTo(version) >= (isFloorInclusive ? 1 : 0)) {
    return false;
  }
  if (ceilingVersion == null) {
    return true;
  }
  return ceilingVersion.compareTo(version) >= (isCeilingInclusive ? 0 : 1);
}

代码示例来源:origin: net.tirasa.connid/connector-framework

/**
 * Internal isEmpty behavior.
 *
 * @return {@code true} if this version range is empty; {@code false}
 *         otherwise.
 */
private boolean isEmpty0() {
  if (ceilingVersion == null) { // infinity
    return false;
  }
  int comparison = floorVersion.compareTo(ceilingVersion);
  if (comparison == 0) { // endpoints equal
    return !isFloorInclusive || !isCeilingInclusive;
  }
  return comparison > 0; // true if left > right
}

代码示例来源:origin: Tirasa/ConnId

/**
 * Internal isEmpty behavior.
 *
 * @return {@code true} if this version range is empty; {@code false}
 *         otherwise.
 */
private boolean isEmpty0() {
  if (ceilingVersion == null) { // infinity
    return false;
  }
  int comparison = floorVersion.compareTo(ceilingVersion);
  if (comparison == 0) { // endpoints equal
    return !isFloorInclusive || !isCeilingInclusive;
  }
  return comparison > 0; // true if left > right
}

代码示例来源:origin: Tirasa/ConnId

private void assertCompGt(Version v1, Version v2) {
    assertTrue(v1.compareTo(v2) > 0);
  }
}

代码示例来源:origin: Tirasa/ConnId

private void assertCompLt(Version v1, Version v2) {
  assertTrue(v1.compareTo(v2) < 0);
}

代码示例来源:origin: Tirasa/ConnId

private void assertCompEq(Version v1, Version v2) {
  assertTrue(v1.compareTo(v2) == 0);
}

代码示例来源:origin: Tirasa/ConnId

if (ATT_FRAMEWORK_VERSION.equals(key)) {
  frameworkVersion = (String) bundleHeaders.get(key);
  if (version.compareTo(Version.parse(frameworkVersion)) < 0) {

代码示例来源:origin: Tirasa/ConnId

if (FrameworkUtil.getFrameworkVersion().compareTo(Version.parse(frameworkVersion)) < 0) {
  String message =
      "Bundle " + parsed.getLocation() + " requests an unrecognized framework version "

代码示例来源:origin: net.tirasa.connid/connector-framework

new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion
        .getMicro(), floorVersion.getRevision() + 1);
return adjacent1.compareTo(ceilingVersion) >= 0;
    new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion
        .getMicro(), floorVersion.getRevision() + 2);
return adjacent2.compareTo(ceilingVersion) >= 0;

代码示例来源:origin: Tirasa/ConnId

new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion
        .getMicro(), floorVersion.getRevision() + 1);
return adjacent1.compareTo(ceilingVersion) >= 0;
    new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion
        .getMicro(), floorVersion.getRevision() + 2);
return adjacent2.compareTo(ceilingVersion) >= 0;

代码示例来源:origin: org.connid/connid-framework-internal

/**
 * Parses the manifest.
 * @return The manifest. Note that the classes/classloaders will
 * not be populated yet. That is to be done at a higher-level.
 * @throws ConfigurationException If there were any structural problems.
 */
public ConnectorBundleManifest parse() throws ConfigurationException {
  String frameworkVersion = getRequiredAttribute(ATT_FRAMEWORK_VERSION);
  String bundleName = getRequiredAttribute(ATT_BUNDLE_NAME);
  String bundleVersion =getRequiredAttribute(ATT_BUNDLE_VERSION);
  if (FrameworkUtil.getFrameworkVersion().compareTo(Version.parse(frameworkVersion)) < 0) {
    String message = "Bundle " + _fileName + " requests an unrecognized " +
        "framework version " + frameworkVersion + " but available is " +
        FrameworkUtil.getFrameworkVersion().getVersion();
    throw new ConfigurationException(message);
  }
  ConnectorBundleManifest rv = new ConnectorBundleManifest();
  rv.setFrameworkVersion(frameworkVersion);
  rv.setBundleName(bundleName);
  rv.setBundleVersion(bundleVersion);
  return rv;
}

代码示例来源:origin: net.tirasa.connid/connector-framework-internal

/**
 * Parses the manifest.
 *
 * @return The manifest. Note that the classes/classloaders will not be populated yet. That is to be done at a
 * higher-level.
 * @throws ConfigurationException if there were any structural problems.
 */
public ConnectorBundleManifest parse() throws ConfigurationException {
  String frameworkVersion = getRequiredAttribute(ATT_FRAMEWORK_VERSION);
  String bundleName = getRequiredAttribute(ATT_BUNDLE_NAME);
  String bundleVersion = getRequiredAttribute(ATT_BUNDLE_VERSION);
  if (FrameworkUtil.getFrameworkVersion().compareTo(Version.parse(frameworkVersion)) < 0) {
    String message =
        "Bundle " + fileName + " requests an unrecognized " + "framework version "
        + frameworkVersion + " but available is "
        + FrameworkUtil.getFrameworkVersion().getVersion();
    throw new ConfigurationException(message);
  }
  ConnectorBundleManifest rv = new ConnectorBundleManifest();
  rv.setFrameworkVersion(frameworkVersion);
  rv.setBundleName(bundleName);
  rv.setBundleVersion(bundleVersion);
  return rv;
}

代码示例来源:origin: Tirasa/ConnId

/**
 * Parses the manifest.
 *
 * @return The manifest. Note that the classes/classloaders will not be populated yet. That is to be done at a
 * higher-level.
 * @throws ConfigurationException if there were any structural problems.
 */
public ConnectorBundleManifest parse() throws ConfigurationException {
  String frameworkVersion = getRequiredAttribute(ATT_FRAMEWORK_VERSION);
  String bundleName = getRequiredAttribute(ATT_BUNDLE_NAME);
  String bundleVersion = getRequiredAttribute(ATT_BUNDLE_VERSION);
  if (FrameworkUtil.getFrameworkVersion().compareTo(Version.parse(frameworkVersion)) < 0) {
    String message =
        "Bundle " + fileName + " requests an unrecognized " + "framework version "
        + frameworkVersion + " but available is "
        + FrameworkUtil.getFrameworkVersion().getVersion();
    throw new ConfigurationException(message);
  }
  ConnectorBundleManifest rv = new ConnectorBundleManifest();
  rv.setFrameworkVersion(frameworkVersion);
  rv.setBundleName(bundleName);
  rv.setBundleVersion(bundleVersion);
  return rv;
}

相关文章