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

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

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

Version.<init>介绍

暂无

代码示例

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

/**
 * Creates a new version from components.
 *
 * @param components the components
 */
public static Version create(Integer... components) {
  return new Version(components);
}

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

/**
 * Creates a new version from components.
 *
 * @param components
 *            the components
 */
public static Version create(Integer... components) {
  return new Version(components);
}

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

/**
 * Creates a new version from components.
 *
 * @param components
 *            the components
 */
public static Version create(Integer... components) {
  return new Version(components);
}

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

/**
 * Parses the passed version string. The string can contain up to
 * four numeric component separated by a dot, followed by an alphanumberic
 * qualifier prepended by a dash. For example, the following are valid
 * versions:
 * <ul>
 *   <li>1</li>
 *   <li>1.1</li>
 *   <li>1.1.0</li>
 *   <li>1.2.3-alpha</li>
 *   <li>1.2.3.4-SNAPSHOT</li>
 * </ul>
 *
 * @param version the version string.
 */
public static Version parse(String version) {
  return new Version(parseInternal(version));
}

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

/**
 * Parses the passed version string. The string can contain up to four
 * numeric component separated by a dot, followed by an alphanumberic
 * qualifier prepended by a dash. For example, the following are valid
 * versions:
 * <ul>
 * <li>1</li>
 * <li>1.1</li>
 * <li>1.1.0</li>
 * <li>1.2.3-alpha</li>
 * <li>1.2.3.4-SNAPSHOT</li>
 * </ul>
 *
 * @param version
 *            the version string.
 */
public static Version parse(String version) {
  return new Version(parseInternal(version));
}

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

/**
 * Parses the passed version string. The string can contain up to four
 * numeric component separated by a dot, followed by an alphanumberic
 * qualifier prepended by a dash. For example, the following are valid
 * versions:
 * <ul>
 * <li>1</li>
 * <li>1.1</li>
 * <li>1.1.0</li>
 * <li>1.2.3-alpha</li>
 * <li>1.2.3.4-SNAPSHOT</li>
 * </ul>
 *
 * @param version
 *            the version string.
 */
public static Version parse(String version) {
  return new Version(parseInternal(version));
}

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

@Test
public void testParse() {
  assertEquals(new Version(1), Version.parse("1"));
  assertEquals(new Version(1), Version.parse("1-alpha"));
  assertEquals(new Version(1, 2), Version.parse("1.2"));
  assertEquals(new Version(1, 2), Version.parse("1.2-alpha"));
  assertEquals(new Version(1, 2, 3), Version.parse("1.2.3"));
  assertEquals(new Version(1, 2, 3), Version.parse("1.2.3-alpha"));
  assertEquals(new Version(1, 2, 3, 4), Version.parse("1.2.3.4"));
  assertEquals(new Version(1, 2, 3, 4), Version.parse("1.2.3.4-alpha"));
}

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

@Test
public void testIsInRange() throws Exception {
  Version reference0 = new Version(1, 1, 0, 0);
  Version reference1 = new Version(1, 1, 0, 1);
  Version reference2 = new Version(1, 1, 0, 2);
  Version reference3 = new Version(1, 1, 0, 3);
  Version reference4 = new Version(1, 1, 0, 4);
  VersionRange range = VersionRange.parse("[1.1.0.1,1.1.0.3)");
  assertFalse(range.isInRange(reference0));
  assertTrue(range.isInRange(reference1));
  assertTrue(range.isInRange(reference2));
  assertFalse(range.isInRange(reference3));
  assertFalse(range.isInRange(reference4));
}

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

@Test
public void testCompare() {
  assertCompEq(new Version(1), Version.parse("1"));
  assertCompEq(new Version(1, 2), Version.parse("1.2"));
  assertCompEq(new Version(1, 2, 3), Version.parse("1.2.3"));
  assertCompEq(new Version(1, 2, 3, 4), Version.parse("1.2.3.4"));
  assertCompEq(new Version(1), Version.parse("1.0"));
  assertCompEq(new Version(1), Version.parse("1.0.0"));
  assertCompEq(new Version(1), Version.parse("1.0.0.0"));
  assertCompEq(new Version(1, 2), Version.parse("1.2.0"));
  assertCompEq(new Version(1, 2), Version.parse("1.2.0.0"));
  assertCompEq(new Version(1, 2, 3), Version.parse("1.2.3.0"));
  assertCompLt(new Version(1, 2), Version.parse("1.3"));
  assertCompLt(new Version(1, 2, 3), Version.parse("1.2.4"));
  assertCompLt(new Version(1, 2, 3, 4), Version.parse("1.2.3.5"));
  assertCompLt(new Version(2), Version.parse("3"));
  assertCompLt(new Version(2), Version.parse("2.1"));
  assertCompLt(new Version(2, 3), Version.parse("2.3.4"));
  assertCompLt(new Version(2, 3, 4), Version.parse("2.3.4.5"));
  assertCompGt(new Version(1, 2), Version.parse("1.1"));
  assertCompGt(new Version(1, 2, 3), Version.parse("1.2.2"));
  assertCompGt(new Version(1, 2, 3, 4), Version.parse("1.2.3.3"));
  assertCompGt(new Version(2), Version.parse("1"));
  assertCompGt(new Version(2), Version.parse("1.0"));
  assertCompGt(new Version(2, 3), Version.parse("2.2.0"));
  assertCompGt(new Version(2, 3, 4), Version.parse("2.3.3.0"));
}

代码示例来源: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() + 1);
return adjacent1.equals(ceilingVersion);
    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() + 1);
return adjacent1.equals(ceilingVersion);
    new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion
        .getMicro(), floorVersion.getRevision() + 2);
return adjacent2.compareTo(ceilingVersion) >= 0;

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

@Test
public void testCornerCases() {
  Version v = Version.parse("1.0");
  assertEquals(v.getMajor(), Integer.valueOf(1));
  assertEquals(v.getMinor(), Integer.valueOf(0));
  assertNull(v.getMicro());
  assertNull(v.getRevision());
  try {
    new Version();
    fail();
  } catch (IllegalArgumentException e) {
    // OK.
  }
  try {
    Version.parse(" ");
    fail();
  } catch (IllegalArgumentException e) {
    // OK.
  }
  try {
    Version.parse("foo");
    fail();
  } catch (IllegalArgumentException e) {
    // OK.
  }
}

相关文章