org.sonatype.aether.version.Version.compareTo()方法的使用及代码示例

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

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

Version.compareTo介绍

暂无

代码示例

代码示例来源:origin: sonatype/sonatype-aether

private boolean isNearer( Position pos1, Version ver1, Position pos2, Version ver2 )
{
  if ( pos1.depth < pos2.depth )
  {
    return true;
  }
  else if ( pos1.depth == pos2.depth && pos1.parent == pos2.parent && ver1.compareTo( ver2 ) > 0 )
  {
    return true;
  }
  return false;
}

代码示例来源:origin: io.fabric8.fab/fab-core

private boolean isNearer(Position pos1, Version ver1, Position pos2, Version ver2) {
  if (pos1.depth < pos2.depth) {
    return true;
  } else if (pos1.depth == pos2.depth && pos1.parent == pos2.parent && ver1.compareTo(ver2) > 0) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.fusesource.fabric.fab/fab-core

private boolean isNearer(Position pos1, Version ver1, Position pos2, Version ver2) {
  if (pos1.depth < pos2.depth) {
    return true;
  } else if (pos1.depth == pos2.depth && pos1.parent == pos2.parent && ver1.compareTo(ver2) > 0) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.fusesource.fabric.fab/fabric-fab-core

private boolean isNearer(Position pos1, Version ver1, Position pos2, Version ver2) {
  if (pos1.depth < pos2.depth) {
    return true;
  } else if (pos1.depth == pos2.depth && pos1.parent == pos2.parent && ver1.compareTo(ver2) > 0) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.sonatype.nexus.plugins/nexus-indexer-lucene-plugin

@Override
public int compareTo(StringVersion other) {
 int c = version.compareTo(other.version);
 if (c != 0) {
  return c;
 }
 return string.compareTo(other.string);
}

代码示例来源:origin: sonatype/sonatype-aether

public boolean containsVersion( Version version )
{
  if ( lowerBound != null )
  {
    int comparison = lowerBound.compareTo( version );
    if ( comparison == 0 && !lowerBoundInclusive )
    {
      return false;
    }
    if ( comparison > 0 )
    {
      return false;
    }
  }
  if ( upperBound != null )
  {
    int comparison = upperBound.compareTo( version );
    if ( comparison == 0 && !upperBoundInclusive )
    {
      return false;
    }
    if ( comparison < 0 )
    {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.sonatype.aether/aether-test-util

int comparison = lowerBound.compareTo( version );
int comparison = upperBound.compareTo( version );

代码示例来源:origin: sonatype/sonatype-aether

int comparison = lowerBound.compareTo( version );
int comparison = upperBound.compareTo( version );

代码示例来源:origin: org.sonatype.aether/aether-test-util

if ( upperBound.compareTo( lowerBound ) < 0 )

代码示例来源:origin: sonatype/sonatype-aether

if ( upperBound.compareTo( lowerBound ) < 0 )

代码示例来源:origin: sonatype/sonatype-aether

if ( upperBound.compareTo( lowerBound ) < 0 )

代码示例来源:origin: jcabi/jcabi-aether

/**
 * Find which artifact has newer version.
 * @param child One of the artifacts to compare.
 * @param found Second artifact to compare.
 * @return Newer artifact of the two provided.
 */
private static Artifact newer(final Artifact child, final Artifact found) {
  final VersionScheme scheme = new GenericVersionScheme();
  final Artifact newer;
  try {
    if (scheme.parseVersion(child.getVersion())
      .compareTo(scheme.parseVersion(found.getVersion())) < 0) {
      newer = found;
    } else {
      newer = child;
    }
  } catch (final InvalidVersionSpecificationException ex) {
    throw new IllegalStateException(ex);
  }
  return newer;
}

相关文章