本文整理了Java中com.google.cloud.compute.deprecated.ZoneId.getSelfLink()
方法的一些代码示例,展示了ZoneId.getSelfLink()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneId.getSelfLink()
方法的具体详情如下:
包路径:com.google.cloud.compute.deprecated.ZoneId
类名称:ZoneId
方法名:getSelfLink
暂无
代码示例来源:origin: googleapis/google-cloud-java
@Override
public String apply(ZoneId zoneId) {
return zoneId.getSelfLink();
}
};
代码示例来源:origin: googleapis/google-cloud-java
Disk toPb() {
Disk diskPb = configuration.toPb();
if (generatedId != null) {
diskPb.setId(new BigInteger(generatedId));
}
if (creationTimestamp != null) {
diskPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp));
}
diskPb.setZone(diskId.getZoneId().getSelfLink());
if (creationStatus != null) {
diskPb.setStatus(creationStatus.toString());
}
diskPb.setName(diskId.getDisk());
diskPb.setDescription(description);
diskPb.setSelfLink(diskId.getSelfLink());
if (licenses != null) {
diskPb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION));
}
if (attachedInstances != null) {
diskPb.setUsers(Lists.transform(attachedInstances, InstanceId.TO_URL_FUNCTION));
}
if (lastAttachTimestamp != null) {
diskPb.setLastAttachTimestamp(TIMESTAMP_FORMATTER.print(lastAttachTimestamp));
}
if (lastDetachTimestamp != null) {
diskPb.setLastDetachTimestamp(TIMESTAMP_FORMATTER.print(lastDetachTimestamp));
}
return diskPb;
}
代码示例来源:origin: googleapis/google-cloud-java
com.google.api.services.compute.model.DiskType toPb() {
com.google.api.services.compute.model.DiskType diskTypePb =
new com.google.api.services.compute.model.DiskType();
if (generatedId != null) {
diskTypePb.setId(new BigInteger(generatedId));
}
if (creationTimestamp != null) {
diskTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp));
}
diskTypePb.setDescription(description);
diskTypePb.setValidDiskSize(validDiskSize);
diskTypePb.setSelfLink(diskTypeId.getSelfLink());
diskTypePb.setDefaultDiskSizeGb(defaultDiskSizeGb);
diskTypePb.setZone(diskTypeId.getZoneId().getSelfLink());
if (deprecationStatus != null) {
diskTypePb.setDeprecated(deprecationStatus.toPb());
}
return diskTypePb;
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testToAndFromUrl() {
ZoneId zoneId = ZoneId.of(PROJECT, ZONE);
compareZoneId(zoneId, ZoneId.fromUrl(zoneId.getSelfLink()));
}
代码示例来源:origin: googleapis/google-cloud-java
com.google.api.services.compute.model.Zone toPb() {
com.google.api.services.compute.model.Zone zonePb =
new com.google.api.services.compute.model.Zone();
if (generatedId != null) {
zonePb.setId(new BigInteger(generatedId));
}
if (creationTimestamp != null) {
zonePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp));
}
zonePb.setName(zoneId.getZone());
zonePb.setDescription(description);
zonePb.setSelfLink(zoneId.getSelfLink());
if (status != null) {
zonePb.setStatus(status.name());
}
if (region != null) {
zonePb.setRegion(region.getSelfLink());
}
if (deprecationStatus != null) {
zonePb.setDeprecated(deprecationStatus.toPb());
}
return zonePb;
}
代码示例来源:origin: googleapis/google-cloud-java
private void compareZoneId(ZoneId expected, ZoneId value) {
assertEquals(expected, value);
assertEquals(expected.getProject(), expected.getProject());
assertEquals(expected.getZone(), expected.getZone());
assertEquals(expected.getSelfLink(), expected.getSelfLink());
assertEquals(expected.hashCode(), expected.hashCode());
}
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testMatchesUrl() {
assertTrue(ZoneId.matchesUrl(ZoneId.of(PROJECT, ZONE).getSelfLink()));
assertFalse(ZoneId.matchesUrl("notMatchingUrl"));
}
代码示例来源:origin: googleapis/google-cloud-java
instancePb.setDescription(description);
instancePb.setSelfLink(instanceId.getSelfLink());
instancePb.setZone(instanceId.getZoneId().getSelfLink());
if (status != null) {
instancePb.setStatus(status.name());
代码示例来源:origin: googleapis/google-cloud-java
break;
case ZONE:
operationPb.setZone(this.<ZoneOperationId>getOperationId().getZoneId().getSelfLink());
break;
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testOf() {
ZoneId zoneId = ZoneId.of(PROJECT, ZONE);
assertEquals(PROJECT, zoneId.getProject());
assertEquals(ZONE, zoneId.getZone());
assertEquals(URL, zoneId.getSelfLink());
zoneId = ZoneId.of(ZONE);
assertNull(zoneId.getProject());
assertEquals(ZONE, zoneId.getZone());
}
内容来源于网络,如有侵权,请联系作者删除!