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

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

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

Guid.getUuid介绍

暂无

代码示例

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

/**
 * This constructor should never be used directly - use {@link #Empty} instead.
 * It is left here only because GWT requires it.
 */
@Deprecated
private Guid() {
  this(Empty.getUuid());
}

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

public Guid(String candidate) {
  if (candidate == null) {
    throw new NullPointerException(
        "candidate can not be null please use static method createGuidFromString");
  }
  if (candidate.isEmpty()) {
    uuid = Empty.getUuid();
  } else {
    uuid = UUID.fromString(candidate);
  }
}

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

@Override
public int compareTo(Guid other) {
  return this.getUuid().compareTo(other.getUuid());
}

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

@Override
public List<Label> getAllByIds(Iterable<Guid> ids) {
  List<UUID> uuids = new ArrayList<>();
  for (Guid guid: ids) {
    uuids.add(guid.getUuid());
  }
  MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource()
      .addValue("label_ids", createArrayOf("uuid", uuids.toArray()));
  return getCallsHandler()
      .executeReadList("GetLabelByIds", labelRowMapper, parameterSource);
}

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

@Override
public List<Label> getAllByEntityIds(Iterable<Guid> entities) {
  List<UUID> uuids = new ArrayList<>();
  for (Guid guid: entities) {
    uuids.add(guid.getUuid());
  }
  MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource()
      .addValue("entity_ids", createArrayOf("uuid", uuids.toArray()));
  return getCallsHandler()
      .executeReadList("GetLabelsByReferencedIds", labelRowMapper, parameterSource);
}

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

@Override
public MapSqlParameterSource addValue(String paramName, Object value) {
  Object tmpValue = value;
  // just to be safe
  if (tmpValue != null) {
    // lets check if we need to translate value
    if (tmpValue instanceof Enum) {
      tmpValue = extractEnumValue(tmpValue);
    } else if (tmpValue instanceof Guid) {
      tmpValue = ((Guid) tmpValue).getUuid();
    } else if (tmpValue instanceof Version) {
      tmpValue = value.toString();
    }
  }
  return super.addValue(dialect.getParamNamePrefix() + paramName, tmpValue);
}

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

@Override
public void nullifyQosForStorageDomain(Guid storageDomainId) {
  getCallsHandler().executeModification("nullifyQosForStorageDomain",
      getCustomMapSqlParameterSource().addValue("storage_domain_id", storageDomainId.getUuid()));
}

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

/**
 * Ensures that a collection of tags is returned.
 */
@Test
public void testGetAllForVm() {
  List<Tags> result = dao.getAllForTemplate(template.getUuid().toString());
  assertNotNull(result);
  assertFalse(result.isEmpty());
}

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

/**
 * Ensures that a collection of tags is returned.
 */
@Test
public void testGetAllForTemplate() {
  List<Tags> result = dao.getAllForTemplate(vm.getUuid().toString());
  assertNotNull(result);
  assertFalse(result.isEmpty());
}

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

/**
 * Ensures that the right set of tags are returned for a specified user.
 */
@Test
public void testGetAllForUser() {
  List<Tags> result = dao.getAllForUsers(user.getUuid().toString());
  assertNotNull(result);
  assertFalse(result.isEmpty());
}

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

@Override
public List<T> getAllForStoragePoolId(Guid storagePoolId) {
  MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource()
      .addValue("storage_pool_id", storagePoolId.getUuid())
      .addValue("qos_type", getQosType());
  return getCallsHandler().executeReadList("GetAllQosForStoragePoolByQosType",
      createEntityRowMapper(),
      parameterSource);
}

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

/**
 * Asserts that an VDS with no tags returns an empty collection.
 */
@Test
public void testGetAllForVdsWithInvalidVds() {
  List<Tags> result = dao.getAllForVds(Guid.newGuid().getUuid()
      .toString());
  assertNotNull(result);
  assertTrue(result.isEmpty());
}

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

/**
 * Ensures that an empty collection is returned.
 */
@Test
public void testGetAllForVmWithInvalidVm() {
  List<Tags> result = dao
      .getAllForVm(Guid.newGuid().getUuid().toString());
  assertNotNull(result);
  assertTrue(result.isEmpty());
}

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

/**
 * Ensures that an empty collection is returned.
 */
@Test
public void testGetAllForUserIdsWithInvalidIds() {
  List<Tags> result = dao.getAllForUsersWithIds(Guid.newGuid().getUuid()
      .toString());
  assertNotNull(result);
  assertTrue(result.isEmpty());
}

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

/**
 * Ensures that an empty collection is returned.
 */
@Test
public void testGetAllForVmWithInvalidTemplate() {
  List<Tags> result = dao
      .getAllForTemplate(Guid.newGuid().getUuid().toString());
  assertNotNull(result);
  assertTrue(result.isEmpty());
}

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

@Test
public void testAddValueGuid() {
  Guid guid = new Guid(UUID.randomUUID());
  paramSource.addValue(paramName, guid);
  assertEquals(
      guid.getUuid(),
      paramSource.getValue(paramName), "wrong value returned from parameter source");
}

相关文章