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

x33g5p2x  于2022-01-20 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(124)

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

Guid.hashCode介绍

暂无

代码示例

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

@Override
public int hashCode() {
 int hashCode = 23;
 hashCode = (hashCode * 37) + (sourceVmGuid == null ? 1 : sourceVmGuid.hashCode());
 hashCode = (hashCode * 37) + new Boolean(pinned).hashCode();
 hashCode = (hashCode * 37) + new Integer(sourceVNumaNodeIndex).hashCode();
 hashCode = (hashCode * 37) + new Integer(targetNumaNodeIndex).hashCode();
 return hashCode;
}

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

@Override
public int hashCode() {
  return getId().hashCode();
}

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

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((id == null) ? 0 : id.hashCode());
  result = prime * result + ((adElementId == null) ? 0 : adElementId.hashCode());
  result = prime * result + ((objectId == null) ? 0 : objectId.hashCode());
  result = prime * result + ((objectName == null) ? 0 : objectName.hashCode());
  result = prime * result + ((objectType == null) ? 0 : objectType.hashCode());
  result = prime * result + ((ownerName == null) ? 0 : ownerName.hashCode());
  result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
  result = prime * result + ((roleType == null) ? 0 : roleType.hashCode());
  result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
  result = prime * result + ((authz == null) ? 0 : authz.hashCode());
  result = prime * result + ((namespace == null) ? 0 : namespace.hashCode());
  result = prime * result + (int) creationDate;
  return result;
}

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

result = prime * result + ((snapshots == null) ? 0 : snapshots.hashCode());
result = prime * result + ((spiceDriverVersion == null) ? 0 : spiceDriverVersion.hashCode());
result = prime * result + ((storagePoolId == null) ? 0 : storagePoolId.hashCode());
result = prime * result + ((storagePoolName == null) ? 0 : storagePoolName.hashCode());
result = prime * result + (transparentHugePages ? 1231 : 1237);
result = prime * result + ((clusterName == null) ? 0 : clusterName.hashCode());
result = prime * result + ((vmDynamic == null) ? 0 : vmDynamic.hashCode());
result = prime * result + ((vmPoolId == null) ? 0 : vmPoolId.hashCode());
result = prime * result + ((vmPoolName == null) ? 0 : vmPoolName.hashCode());
result = prime * result + ((vmStatic == null) ? 0 : vmStatic.hashCode());

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

@Override
protected org.ovirt.engine.core.common.scheduling.AffinityGroup getEntity(int index) {
  org.ovirt.engine.core.common.scheduling.AffinityGroup entity =
      mock(org.ovirt.engine.core.common.scheduling.AffinityGroup.class);
  when(entity.getId()).thenReturn(GUIDS[index]);
  when(entity.getName()).thenReturn(NAMES[index]);
  when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]);
  when(entity.getClusterId()).thenReturn(CLUSTER_ID);
  when(entity.isVmEnforcing()).thenReturn(GUIDS[index].hashCode() % 2 == 0);
  when(entity.isVmPositive()).thenReturn(GUIDS[index].hashCode() % 2 == 1);
  return entity;
}

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

@Override
protected org.ovirt.engine.core.common.scheduling.AffinityGroup getEntity(int index) {
  org.ovirt.engine.core.common.scheduling.AffinityGroup entity =
      mock(org.ovirt.engine.core.common.scheduling.AffinityGroup.class);
  when(entity.getId()).thenReturn(GUIDS[index]);
  when(entity.getName()).thenReturn(NAMES[index]);
  when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]);
  when(entity.getClusterId()).thenReturn(CLUSTER_ID);
  when(entity.isVmEnforcing()).thenReturn((GUIDS[index].hashCode() & 1) == 0);
  when(entity.isVmPositive()).thenReturn((GUIDS[index].hashCode() & 1) == 1);
  return entity;
}

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

static AffinityGroup getModel(int index) {
    AffinityGroup model = new AffinityGroup();
    model.setId(GUIDS[0].toString());
    model.setName(NAMES[index]);
    model.setDescription(DESCRIPTIONS[index]);
    model.setCluster(new Cluster());
    model.getCluster().setId(CLUSTER_ID.toString());
    model.setEnforcing((GUIDS[index].hashCode() & 1) == 0);
    model.setPositive((GUIDS[index].hashCode() & 1) == 1);

    return model;
  }
}

相关文章