org.ovirt.engine.core.compat.Version.getBuild()方法的使用及代码示例

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

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

Version.getBuild介绍

暂无

代码示例

代码示例来源:origin: oVirt/ovirt-engine

public OS(String name, Version version, String fullVersion) {
  Objects.requireNonNull(name);
  Objects.requireNonNull(version);
  this.name = name.trim();
  this.version = new Version(version.getMajor(), version.getMinor(), version.getBuild(), version.getRevision());
  this.fullVersion = fullVersion;
}

代码示例来源:origin: oVirt/ovirt-engine

if (iso.getMinor() > hostVersion.getMinor() || iso.getBuild() > hostVersion.getBuild()) {
  return true;

代码示例来源:origin: oVirt/ovirt-engine

public static Version map(org.ovirt.engine.core.compat.Version versionEngine) {
  Version versionApi = new Version();
  versionApi.setMajor(versionEngine.getMajor() >= 0 ? versionEngine.getMajor() : null);
  versionApi.setMinor(versionEngine.getMinor() >= 0 ? versionEngine.getMinor() : null);
  versionApi.setBuild(versionEngine.getBuild() >= 0 ? versionEngine.getBuild() : null);
  versionApi.setRevision(versionEngine.getRevision() >= 0 ? versionEngine.getRevision() : null);
  return versionApi;
}

代码示例来源:origin: oVirt/ovirt-engine

@Test
public void shouldHandleAlNumFullVersion() {
  final OS validOs = OS.fromPackageVersionString("Centos - 7.3.2Server - release");
  assertThat(validOs.isValid()).isTrue();
  assertThat(validOs.getVersion().getMajor()).isEqualTo(7);
  assertThat(validOs.getVersion().getMinor()).isEqualTo(3);
  assertThat(validOs.getVersion().getBuild()).isEqualTo(2);
}

代码示例来源:origin: oVirt/ovirt-engine

private static OperatingSystem mapOperatingSystem(VDS entity) {
  final OperatingSystem model = new OperatingSystem();
  if (StringUtils.isNotBlank(entity.getHostOs())) {
    OS hostOs = OS.fromPackageVersionString(entity.getHostOs());
    Version version = new Version();
    if (hostOs.getVersion().getMajor() != VERSION_NOT_SET) {
      version.setMajor(hostOs.getVersion().getMajor());
    }
    if (hostOs.getVersion().getMinor() != VERSION_NOT_SET) {
      version.setMinor(hostOs.getVersion().getMinor());
    }
    if (hostOs.getVersion().getBuild() != VERSION_NOT_SET) {
      version.setBuild(hostOs.getVersion().getBuild());
    }
    version.setFullVersion(hostOs.getFullVersion());
    model.setVersion(version);
    model.setType(hostOs.getName());
  }
  model.setCustomKernelCmdline(Objects.toString(entity.getCurrentKernelCmdline(), ""));
  model.setReportedKernelCmdline(entity.getKernelArgs());
  return model;
}

相关文章