com.google.cloud.dns.ZoneInfo.getGeneratedId()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(107)

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

ZoneInfo.getGeneratedId介绍

[英]Returns the service-generated id for this zone.
[中]返回此区域的服务生成id。

代码示例

代码示例来源:origin: googleapis/google-cloud-java

@Override
 public String toString() {
  return MoreObjects.toStringHelper(this)
    .add("name", getName())
    .add("generatedId", getGeneratedId())
    .add("description", getDescription())
    .add("dnsName", getDnsName())
    .add("nameServerSet", getNameServerSet())
    .add("nameServers", getNameServers())
    .add("creationTimeMillis", getCreationTimeMillis())
    .toString();
 }
}

代码示例来源:origin: googleapis/google-cloud-java

ManagedZone toPb() {
 ManagedZone pb = new ManagedZone();
 pb.setDescription(this.getDescription());
 pb.setDnsName(this.getDnsName());
 if (this.getGeneratedId() != null) {
  pb.setId(new BigInteger(this.getGeneratedId()));
 }
 pb.setName(this.getName());
 pb.setNameServers(this.nameServers); // do use real attribute value which may be null
 pb.setNameServerSet(this.getNameServerSet());
 if (this.getCreationTimeMillis() != null) {
  pb.setCreationTime(
    DATE_TIME_FORMATTER.format(Instant.ofEpochMilli(this.getCreationTimeMillis())));
 }
 return pb;
}

代码示例来源:origin: googleapis/google-cloud-java

@Test
public void testBuilder() {
 assertEquals(3, INFO.getNameServers().size());
 assertEquals(NS1, INFO.getNameServers().get(0));
 assertEquals(NS2, INFO.getNameServers().get(1));
 assertEquals(NS3, INFO.getNameServers().get(2));
 assertEquals(NAME, INFO.getName());
 assertEquals(GENERATED_ID, INFO.getGeneratedId());
 assertEquals(CREATION_TIME_MILLIS, INFO.getCreationTimeMillis());
 assertEquals(NAME_SERVER_SET, INFO.getNameServerSet());
 assertEquals(DESCRIPTION, INFO.getDescription());
 assertEquals(DNS_NAME, INFO.getDnsName());
}

代码示例来源:origin: googleapis/google-cloud-java

@Test
public void testOf() {
 ZoneInfo partial = ZoneInfo.of(NAME, DNS_NAME, DESCRIPTION);
 assertTrue(partial.getNameServers().isEmpty());
 assertEquals(NAME, partial.getName());
 assertNull(partial.getGeneratedId());
 assertNull(partial.getCreationTimeMillis());
 assertNull(partial.getNameServerSet());
 assertEquals(DESCRIPTION, partial.getDescription());
 assertEquals(DNS_NAME, partial.getDnsName());
}

代码示例来源:origin: googleapis/google-cloud-java

@Test
public void testEqualsAndNotEquals() {
 ZoneInfo clone = INFO.toBuilder().build();
 assertEquals(INFO, clone);
 List<String> moreServers = Lists.newLinkedList(NAME_SERVERS);
 moreServers.add(NS1);
 clone = INFO.toBuilder().setNameServers(moreServers).build();
 assertNotEquals(INFO, clone);
 String differentName = "totally different name";
 clone = INFO.toBuilder().setName(differentName).build();
 assertNotEquals(INFO, clone);
 clone = INFO.toBuilder().setCreationTimeMillis(INFO.getCreationTimeMillis() + 1).build();
 assertNotEquals(INFO, clone);
 clone = INFO.toBuilder().setDescription(INFO.getDescription() + "aaaa").build();
 assertNotEquals(INFO, clone);
 clone = INFO.toBuilder().setDnsName(differentName).build();
 assertNotEquals(INFO, clone);
 clone = INFO.toBuilder().setGeneratedId(INFO.getGeneratedId() + "1111").build();
 assertNotEquals(INFO, clone);
 clone = INFO.toBuilder().setNameServerSet(INFO.getNameServerSet() + "salt").build();
 assertNotEquals(INFO, clone);
}

代码示例来源:origin: com.google.cloud/google-cloud-dns

/**
 * Returns the service-generated id for this zone.
 */
@Deprecated
public String generatedId() {
 return getGeneratedId();
}

代码示例来源:origin: com.google.cloud/google-cloud-dns

@Override
 public String toString() {
  return MoreObjects.toStringHelper(this)
    .add("name", getName())
    .add("generatedId", getGeneratedId())
    .add("description", getDescription())
    .add("dnsName", getDnsName())
    .add("nameServerSet", getNameServerSet())
    .add("nameServers", getNameServers())
    .add("creationTimeMillis", getCreationTimeMillis())
    .toString();
 }
}

代码示例来源:origin: com.google.cloud/google-cloud-dns

ManagedZone toPb() {
 ManagedZone pb =
   new ManagedZone();
 pb.setDescription(this.getDescription());
 pb.setDnsName(this.getDnsName());
 if (this.getGeneratedId() != null) {
  pb.setId(new BigInteger(this.getGeneratedId()));
 }
 pb.setName(this.getName());
 pb.setNameServers(this.nameServers); // do use real attribute value which may be null
 pb.setNameServerSet(this.getNameServerSet());
 if (this.getCreationTimeMillis() != null) {
  pb.setCreationTime(ISODateTimeFormat.dateTime()
    .withZoneUTC()
    .print(this.getCreationTimeMillis()));
 }
 return pb;
}

相关文章