本文整理了Java中org.ovirt.engine.core.compat.Version.greaterOrEquals()
方法的一些代码示例,展示了Version.greaterOrEquals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.greaterOrEquals()
方法的具体详情如下:
包路径:org.ovirt.engine.core.compat.Version
类名称:Version
方法名:greaterOrEquals
暂无
代码示例来源:origin: oVirt/ovirt-engine
public static Source getUrandomOrRandomFor(Version version) {
if (version.greaterOrEquals(FIRST_URANDOM_VERSION)) {
return URANDOM;
}
return RANDOM;
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* @param oldVersion old compatibility version
* @param newVersion new compatibility version
* @return whether or not update of random/urandom rng device is required;
* false if some of the arguments is null
*/
public static boolean urandomRandomUpdateRequired(Version oldVersion, Version newVersion) {
if (Objects.equals(oldVersion, newVersion)) {
return false;
}
if (oldVersion == null || newVersion == null) {
return false;
}
return (newVersion.greaterOrEquals(VmRngDevice.Source.FIRST_URANDOM_VERSION)
&& oldVersion.less(VmRngDevice.Source.FIRST_URANDOM_VERSION))
|| (oldVersion.greaterOrEquals(VmRngDevice.Source.FIRST_URANDOM_VERSION)
&& newVersion.less(VmRngDevice.Source.FIRST_URANDOM_VERSION));
}
}
代码示例来源:origin: oVirt/ovirt-engine
private void updateUrandomLabel(UnitVmModel model) {
final Version effectiveVersion = model.getCompatibilityVersion();
if (effectiveVersion == null) {
return;
}
final String urandomSourceLabel = effectiveVersion.greaterOrEquals(VmRngDevice.Source.FIRST_URANDOM_VERSION)
? constants.rngSourceUrandom()
: constants.rngSourceRandom();
rngSourceUrandom.setLabel(urandomSourceLabel);
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void biggerThanOrEquals() {
assertFalse(Version.v4_2.greaterOrEquals(Version.v4_3));
assertTrue(Version.v4_3.greaterOrEquals(Version.v4_2));
assertTrue(Version.v4_3.greaterOrEquals(new Version("4.3")));
}
@Test
内容来源于网络,如有侵权,请联系作者删除!