本文整理了Java中org.ovirt.engine.core.compat.Guid.equals()
方法的一些代码示例,展示了Guid.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Guid.equals()
方法的具体详情如下:
包路径:org.ovirt.engine.core.compat.Guid
类名称:Guid
方法名:equals
暂无
代码示例来源:origin: oVirt/ovirt-engine
/**
* Check if template is special 'Blank' template or its version.
* <p>Blank template is recognized by id being {@link org.ovirt.engine.core.compat.Guid#Empty}</p>
* @return true if this is Blank template, false otherwise
*/
public boolean isBlank() {
return Guid.Empty.equals(getBaseTemplateId());
}
}
代码示例来源:origin: oVirt/ovirt-engine
private StoragePool findDataCenterById(List<StoragePool> list, Guid id) {
if (id == null) {
return null;
}
for (StoragePool dc : list) {
if (dc.getId().equals(id)) {
return dc;
}
}
return null;
}
代码示例来源:origin: oVirt/ovirt-engine
public Network findNetworkById(Guid networkId) {
for (Network network : clusterNetworks) {
if (network.getId().equals(networkId)) {
return network;
}
}
return null;
}
代码示例来源:origin: oVirt/ovirt-engine
public VmDeviceFeEntity(VmDevice vmDevice, VM vm, boolean beingUnplugged) {
if (!vmDevice.getVmId().equals(vm.getId())) {
throw new IllegalArgumentException("IDs of VM and device's VM doesn't match."); //$NON-NLS-1$
}
this.vmDevice = vmDevice;
this.vm = vm;
this.beingUnplugged = beingUnplugged;
}
代码示例来源:origin: oVirt/ovirt-engine
private boolean containsDisk(DiskImage snapshotDisk, List<DiskImage> disks) {
for (DiskImage disk : disks) {
if (disk.getId().equals(snapshotDisk.getId())) {
return true;
}
}
return false;
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
public void buildDisk() {
XmlNodeList list = selectNodes(_document, "//*/Section/Disk");
for (XmlNode node : list) {
Guid guid = new Guid(node.attributes.get("ovf:diskId").getValue());
_images.stream().filter(d -> d.getImageId().equals(guid)).findFirst().ifPresent(img -> readDisk(node, img));
luns.stream().filter(d -> d.getId().equals(guid)).findFirst().ifPresent(lun -> readLunDisk(node, lun));
}
}
代码示例来源:origin: oVirt/ovirt-engine
public void updateFactor(PolicyUnit policyUnit, Integer factor) {
for (int i = 0; i < usedFunctions.size(); i++) {
if (usedFunctions.get(i).getFirst().getId().equals(policyUnit.getId())) {
usedFunctions.get(i).setSecond(factor);
break;
}
}
}
代码示例来源:origin: oVirt/ovirt-engine
protected org.ovirt.engine.core.common.businessentities.Snapshot getSnapshotById(Guid id) {
//TODO: move to 'GetSnapshotBySnapshotId' once Backend supplies it.
for (org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getBackendCollection(QueryType.GetAllVmSnapshotsByVmId,
new IdQueryParameters(parentId))) {
if (snapshot.getId().equals(id)) {
return snapshot;
}
}
return null;
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
public boolean equals(Object obj) {
boolean returnValue = super.equals(obj);
if (!returnValue && obj != null && obj instanceof VmTemplate) {
returnValue = getId()
.equals(((VmTemplate) obj).getId());
}
return returnValue;
}
代码示例来源:origin: oVirt/ovirt-engine
public org.ovirt.engine.core.common.businessentities.network.Network lookupNetwork(Guid id, String name) {
for (org.ovirt.engine.core.common.businessentities.network.Network entity : getBackendCollection(queryType, getQueryParameters())) {
if ((id != null && id.equals(entity.getId())) ||
(name != null && name.equals(entity.getName()))) {
return entity;
}
}
return null;
}
代码示例来源:origin: oVirt/ovirt-engine
protected org.ovirt.engine.core.common.businessentities.VM getEntity() {
if (vm != null) {
return vm;
}
for (org.ovirt.engine.core.common.businessentities.VM entity : parent.getEntitiesFromExportDomain()) {
if (guid.equals(entity.getId())) {
vm = entity;
return entity;
}
}
return entityNotFound();
}
代码示例来源:origin: oVirt/ovirt-engine
protected VmTemplate getEntity() {
if (template != null) {
return template;
}
for (VmTemplate entity : parent.getEntitiesFromExportDomain()) {
if (guid.equals(entity.getId())) {
template = entity;
return entity;
}
}
return entityNotFound();
}
代码示例来源:origin: oVirt/ovirt-engine
private StoragePool getPreviousDataCenter(List<StoragePool> dataCenters) {
Guid previousDataCenterId = getProxyHostPropertiesModel().getLastStoragePoolId();
for (StoragePool dataCenter : dataCenters) {
if (dataCenter.getId().equals(previousDataCenterId)) {
return dataCenter;
}
}
return null;
}
}));
代码示例来源:origin: oVirt/ovirt-engine
public DiskImage getImageByDiskId(Guid diskId) {
for (DiskImage disk : getEntity().getDiskImages()) {
if (disk.getId().equals(diskId)) {
return disk;
}
}
return null;
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
public boolean test(DataCenterWithCluster source) {
return source.getDataCenter() != null &&
source.getCluster() != null &&
source.getDataCenter().getId().equals(dataCenterId) &&
source.getCluster().getId().equals(clusterId);
}
代码示例来源:origin: oVirt/ovirt-engine
private boolean selectedItemsContainBlankTemplate() {
if (getSelectedItems() != null) {
List<VmTemplate> templates = getSelectedItems();
for (VmTemplate template : templates) {
if (template != null && template.getId().equals(Guid.Empty)) {
return true;
}
}
}
return false;
}
代码示例来源:origin: oVirt/ovirt-engine
public StoragePool getStoragePool() {
if (storagePool == null && getStoragePoolId() != null && !Guid.Empty.equals(getStoragePoolId())) {
storagePool = storagePoolDao.get(getStoragePoolId());
}
return storagePool;
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
public boolean equals(Object o) {
if (getEntity() == null && !(o instanceof NetworkFilterParameterModel)) {
return false;
}
return getEntity().getId().equals(((NetworkFilterParameterModel) o).getEntity().getId())
&& getEntity().getVmInterfaceId().equals(((NetworkFilterParameterModel) o).getEntity().getVmInterfaceId());
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testNUllVmElementForFloatingDisk() {
List<DiskVmElement> allDves = dao.getAll();
assertTrue(allDves.stream().noneMatch(dve -> dve.getDiskId().equals(FixturesTool.FLOATING_DISK_ID)));
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Ensures that updating a cluster status works as expected.
*/
@Test
public void testUpdateStatus() {
existingNetworkCluster.setStatus(NetworkStatus.NON_OPERATIONAL);
dao.updateStatus(existingNetworkCluster);
List<NetworkCluster> result = dao.getAll();
assertTrue(result.stream().anyMatch(t -> t.getClusterId().equals(existingNetworkCluster.getClusterId()) &&
t.getNetworkId().equals(existingNetworkCluster.getNetworkId()) &&
t.getStatus() == existingNetworkCluster.getStatus()));
}
内容来源于网络,如有侵权,请联系作者删除!