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

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

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

Version.toString介绍

暂无

代码示例

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

/**
 * a key can have several values per version. a null version represents the default while other are specific one:
 * key.value = someval // the default value. the path returned is "value" key.value.3.1 = otherval // the 3.1
 * version val. the path returned is "value.3.1"
 *
 * @return the string representation of the value path. for key.value.3.1 = otherval "value.3.1" should be returned.
 */
private String versionedValuePath(Version version) {
  return version == null ? "value" : "value." + version.toString();
}

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

public void setCompatibilityVersion(Version value) {
  compatibilityVersion = value.toString();
  version = null;
}

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

private static Object cloneVersion(Version instance) {
  return new Version(instance.toString());
}

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

private String defaultClusterRngSourcesCsv(Version ver) {
  String srcs = (String) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.ClusterRequiredRngSourcesDefault, ver.toString());
  return (srcs == null)
      ? ""
      : srcs;
}

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

public void getPmTypeList(AsyncQuery<List<String>> aQuery, Version version) {
  aQuery.converterCallback = source -> {
    ArrayList<String> list = new ArrayList<>();
    if (source != null) {
      String[] array = ((String) source).split("[,]", -1); //$NON-NLS-1$
      for (String item : array) {
        list.add(item);
      }
    }
    return list;
  };
  GetConfigurationValueParameters param = new GetConfigurationValueParameters(ConfigValues.VdsFenceType);
  param.setVersion(version != null ? version.toString() : getDefaultConfigurationVersion());
  Frontend.getInstance().runQuery(QueryType.GetFenceConfigurationValue, param, aQuery);
}

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

public static <T> MockConfigDescriptor<T> of(ConfigValues value, Version version, T returnValue) {
  return new MockConfigDescriptor<>(value, version.toString(), returnValue);
}

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

@BeforeEach
public void mockAsyncDataProvider() {
  adp = AsyncDataProvider.getInstance(); // Mocked by UiCommonSetupExtension
  when(adp.getConfigValuePreConverted(ConfigValues.VncKeyboardLayoutValidValues)).thenReturn(Collections.emptyList());
  when(adp.osNameExists(OS_TYPE)).thenReturn(true);
  when(adp.getMaxVmNameLength()).thenReturn(64);
  when(adp.getOsDefaultIconId(OS_TYPE, false)).thenReturn(LARGE_OS_DEFAULT_ICON_ID);
  when(adp.getConfigValuePreConverted(ConfigValues.ResumeBehaviorSupported, CLUSTER_VERSION.toString())).thenReturn(true);
}

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

public void updateMaxNumOfVmCpus() {
  String version = getCompatibilityVersion().toString();
  AsyncDataProvider.getInstance().getMaxNumOfVmCpus(asyncQuery(
      returnValue -> {
        maxCpus = returnValue;
        postUpdateNumOfSockets2();
      }), version);
}

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

public void postUpdateNumOfSockets2() {
  String version = getCompatibilityVersion().toString();
  AsyncDataProvider.getInstance().getMaxNumOfCPUsPerSocket(asyncQuery(
      returnValue -> {
        maxCpusPerSocket = returnValue;
        postUpdateNumOfSockets3();
      }), version);
}

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

public void postUpdateNumOfSockets3() {
  String version = getCompatibilityVersion().toString();
  AsyncDataProvider.getInstance().getMaxNumOfThreadsPerCpu(asyncQuery(
      returnValue -> {
        maxThreadsPerCore = returnValue;
        totalCpuCoresChanged();
      }), version);
}

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

protected void updateNumOfSockets() {
  Version version = getCompatibilityVersion();
  if (version == null) {
    return;
  }
  AsyncDataProvider.getInstance().getMaxNumOfVmSockets(asyncQuery(
      returnValue -> {
        maxNumOfSockets = returnValue;
        updataMaxVmsInPool();
      }), version.toString());
}

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

@Test
public void testToString() {
  assertEquals("1.0", new Version("1.0").toString());
  assertEquals("1.0", new Version("1.0").toString());
  assertEquals("1.2.3", new Version(1, 2, 3).toString());
}

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

@Test
public void testAddValueVersion() {
  Version verision = new Version(this.random.nextInt(), this.random.nextInt());
  paramSource.addValue(paramName, verision);
  assertEquals(
      verision.toString(),
      paramSource.getValue(paramName), "wrong value returned from parameter source");
}

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

private void handleQxlClusterLevel() {
  getBehavior().enableSinglePCI(getIsQxlSupported());
  if (getSelectedCluster() != null) {
    boolean isQxl = getDisplayType().getSelectedItem() == DisplayType.qxl;
    if (!isQxl) {
      handleQxlChangeProhibitionReason(
          getSpiceFileTransferEnabled(),
          getCompatibilityVersion().toString(),
          false);
    }
    getSpiceFileTransferEnabled().setIsChangeable(isQxl);
    GraphicsTypes selectedGraphics = getGraphicsType().getSelectedItem();
    boolean spiceCopyPasteToggle = selectedGraphics != null
        && selectedGraphics.getBackingGraphicsTypes().contains(GraphicsType.SPICE);
    if (!spiceCopyPasteToggle) {
      handleQxlChangeProhibitionReason(
          getSpiceCopyPasteEnabled(),
          getCompatibilityVersion().toString(),
          isQxl);
    }
    getSpiceCopyPasteEnabled().setIsChangeable(spiceCopyPasteToggle);
  }
}

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

@Override
public void edit(final SnapshotModel model) {
  driver.edit(model);
  if (model.isShowMemorySnapshotWarning() && !model.isShowPartialSnapshotWarning()) {
    Style dialogStyle = getParent().getParent().getParent().getElement().getStyle();
    dialogStyle.setWidth(450, Style.Unit.PX);
    dialogStyle.setHeight(240, Style.Unit.PX);
  }
  partialSnapshotWarningPanel.setVisible(model.isShowPartialSnapshotWarning());
  memoryWarningPanel.setVisible(model.isShowMemorySnapshotWarning());
  if (model.getOldClusterVersionOfSnapshotWithMemory() != null) {
    messageLabel.setText(messages.snapshotContainsMemoryIncompatibleCluster(
        model.getOldClusterVersionOfSnapshotWithMemory().toString()));
    model.getMemory().setEntity(false);
  }
  horizontalSeparator.setVisible(model.isShowPartialSnapshotWarning() && model.isShowMemorySnapshotWarning());
  vmDisksLabel.setText(messages.vmDisksLabel(model.getVmDisks().size(),
      String.join(", ", Linq.getDiskAliases(model.getVmDisks())))); //$NON-NLS-1$
  snapshotDisksLabel.setText(messages.snapshotDisksLabel(model.getDisks().size(),
      String.join(", ", Linq.getDiskAliases(model.getDisks())))); //$NON-NLS-1$
}

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

/**
 * Update the available fields based on the selection of the Power Management type list. Certain types will have
 * different fields available to select/fill out.
 */
private void updateFormStatus() {
  String pmType = getPmType().getSelectedItem();
  if (StringHelper.isNotNullOrEmpty(pmType)) {
    String version = AsyncDataProvider.getInstance().getDefaultConfigurationVersion();
    if (getHost().getCluster().getSelectedItem() != null) {
      version = getHost().getCluster().getSelectedItem().getCompatibilityVersion().toString();
    }
    AsyncDataProvider.getInstance().getPmOptions(new AsyncQuery<>(pmOptions -> {
      if (pmOptions != null) {
        getPmPort().setIsAvailable(pmOptions.contains(PM_PORT_KEY));
        getPmSlot().setIsAvailable(pmOptions.contains(PM_SLOT_KEY));
        getPmSecure().setIsAvailable(pmOptions.contains(PM_SECURE_KEY));
        getPmEncryptOptions().setIsAvailable(pmOptions.contains(PM_ENCRYPT_OPTIONS_KEY));
      } else {
        getPmPort().setIsAvailable(false);
        getPmSlot().setIsAvailable(false);
        getPmSecure().setIsAvailable(false);
      }
    }), pmType, version);
    setCiscoUcsPrimaryPmTypeSelected(pmType.equals(CISCO_USC));
  } else {
    getPmPort().setIsAvailable(false);
    getPmSlot().setIsAvailable(false);
    getPmSecure().setIsAvailable(false);
  }
}

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

private void postNicInit() {
  getName().setEntity(AsyncDataProvider.getInstance().getNewNicName(getVmNicList()));
  initMAC();
  getPlugged().setIsChangeable(allowPlug());
  getPlugged().setEntity(allowPlug());
  if (!allowPlug()) {
    getPlugged().setChangeProhibitionReason(ConstantsManager.getInstance()
        .getMessages()
        .nicHotPlugNotSupported(getClusterCompatibilityVersion().toString()));
  }
  initLinked();
  initProfiles();
  initCommands();
}

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

private void postNicInit() {
  getName().setEntity(getNic().getName());
  initMAC();
  initLinked();
  initNetworkFilterParameters(new AsyncQuery<>(returnValue -> {
    getNetworkFilterParameterListModel().setItems(returnValue);
  }));
  initProfiles();
  // Plug should be the last one updated, cause it controls the changeability of the other editor
  getPlugged().setEntity(getNic().isPlugged());
  getPlugged().setIsChangeable(allowPlug());
  if (!allowPlug()) {
    getPlugged().setChangeProhibitionReason(ConstantsManager.getInstance()
        .getMessages()
        .nicHotPlugNotSupported(getClusterCompatibilityVersion().toString()));
  }
  initCommands();
}

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

? vm.getCompatibilityVersion().toString()
: ""); //$NON-NLS-1$

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

if (!getVolatileRun().getIsChangable()) {
  getVolatileRun().setChangeProhibitionReason(
      ConstantsManager.getInstance().getMessages().optionNotSupportedClusterVersionTooOld(vm.getCompatibilityVersion().toString()));

相关文章