本文整理了Java中org.sonatype.aether.version.Version.compareTo()
方法的一些代码示例,展示了Version.compareTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.compareTo()
方法的具体详情如下:
包路径:org.sonatype.aether.version.Version
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!