Skip to content

Commit 81a46d8

Browse files
committed
Renames ManagedZone to Zone. Acommodates codecheck. Fixes #579.
1 parent 4412c73 commit 81a46d8

5 files changed

Lines changed: 80 additions & 84 deletions

File tree

gcloud-java-dns/src/main/java/com/google/gcloud/dns/ChangeRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
/**
3636
* A class representing an atomic update to a collection of {@link DnsRecord}s within a {@code
37-
* ManagedZone}.
37+
* Zone}.
3838
*
3939
* @see <a href="https://cloud.google.com/dns/api/v1/changes">Google Cloud DNS documentation</a>
4040
*/
@@ -102,7 +102,7 @@ public Builder additions(List<DnsRecord> additions) {
102102
this.additions = Lists.newLinkedList(checkNotNull(additions));
103103
return this;
104104
}
105-
105+
106106
/**
107107
* Sets a collection of {@link DnsRecord}s which are to be deleted from the zone upon executing
108108
* this {@code ChangeRequest}.

gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsRecord.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
*
3434
* <p>A {@code DnsRecord} is the unit of data that will be returned by the DNS servers upon a DNS
3535
* request for a specific domain. The {@code DnsRecord} holds the current state of the DNS records
36-
* that make up a managed zone. You can read the records but you cannot modify them directly.
37-
* Rather, you edit the records in a managed zone by creating a ChangeRequest.
36+
* that make up a zone. You can read the records but you cannot modify them directly.
37+
* Rather, you edit the records in a zone by creating a ChangeRequest.
3838
*
3939
* @see <a href="https://cloud.google.com/dns/api/v1/resourceRecordSets">Google Cloud DNS
4040
* documentation</a>

gcloud-java-dns/src/main/java/com/google/gcloud/dns/ProjectInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* The class provides the Google Cloud DNS information associated with this project. A project is a
29-
* top level container for resources including {@code ManagedZone}s. Projects can be created only in
29+
* top level container for resources including {@code Zone}s. Projects can be created only in
3030
* the APIs console.
3131
*
3232
* @see <a href="https://cloud.google.com/dns/api/v1/projects">Google Cloud DNS documentation</a>
@@ -75,7 +75,7 @@ public static class Quota {
7575
}
7676

7777
/**
78-
* Returns the maximum allowed number of managed zones in the project.
78+
* Returns the maximum allowed number of zones in the project.
7979
*/
8080
public int zones() {
8181
return zones;
@@ -104,7 +104,7 @@ public int rrsetDeletionsPerChange() {
104104
}
105105

106106
/**
107-
* Returns the maximum allowed number of {@link DnsRecord}s per {@link ManagedZoneInfo} in the
107+
* Returns the maximum allowed number of {@link DnsRecord}s per {@link ZoneInfo} in the
108108
* project.
109109
*/
110110
public int rrsetsPerManagedZone() {

gcloud-java-dns/src/main/java/com/google/gcloud/dns/ManagedZoneInfo.java renamed to gcloud-java-dns/src/main/java/com/google/gcloud/dns/ZoneInfo.java

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
import java.util.Objects;
3333

3434
/**
35-
* A {@code ManagedZone} represents a DNS zone hosted by the Google Cloud DNS service. A zone is a
36-
* subtree of the DNS namespace under one administrative responsibility. See <a
35+
* A {@code Zone} represents a DNS zone hosted by the Google Cloud DNS service. A zone is a subtree
36+
* of the DNS namespace under one administrative responsibility. See <a
3737
* href="https://cloud.google.com/dns/api/v1/managedZones">Google Cloud DNS documentation</a> for
3838
* more information.
3939
*/
40-
public class ManagedZoneInfo implements Serializable {
40+
public class ZoneInfo implements Serializable {
4141

4242
private static final long serialVersionUID = 201601191647L;
4343
private final String name;
@@ -49,7 +49,7 @@ public class ManagedZoneInfo implements Serializable {
4949
private final List<String> nameServers;
5050

5151
/**
52-
* A builder for {@code ManagedZoneInfo}.
52+
* A builder for {@code ZoneInfo}.
5353
*/
5454
public static class Builder {
5555
private String name;
@@ -61,8 +61,7 @@ public static class Builder {
6161
private List<String> nameServers = new LinkedList<>();
6262

6363
/**
64-
* Returns an empty builder for {@code ManagedZoneInfo}. We use it internally in {@code
65-
* toPb()}.
64+
* Returns an empty builder for {@code ZoneInfo}. We use it internally in {@code toPb()}.
6665
*/
6766
private Builder() {
6867
}
@@ -81,9 +80,9 @@ private Builder(String name, BigInteger id) {
8180
}
8281

8382
/**
84-
* Creates a builder from an existing ManagedZoneInfo object.
83+
* Creates a builder from an existing ZoneInfo object.
8584
*/
86-
Builder(ManagedZoneInfo info) {
85+
Builder(ZoneInfo info) {
8786
this.name = info.name;
8887
this.id = info.id;
8988
this.creationTimeMillis = info.creationTimeMillis;
@@ -102,42 +101,41 @@ public Builder name(String name) {
102101
}
103102

104103
/**
105-
* Sets an id for the managed zone which is assigned to the managed zone by the server.
104+
* Sets an id for the zone which is assigned to the zone by the server.
106105
*/
107106
Builder id(BigInteger id) {
108107
this.id = id;
109108
return this;
110109
}
111110

112111
/**
113-
* Sets the time when this managed zone was created.
112+
* Sets the time when this zone was created.
114113
*/
115114
Builder creationTimeMillis(long creationTimeMillis) {
116115
this.creationTimeMillis = creationTimeMillis;
117116
return this;
118117
}
119118

120119
/**
121-
* Sets a mandatory DNS name of this managed zone, for instance "example.com.".
120+
* Sets a mandatory DNS name of this zone, for instance "example.com.".
122121
*/
123122
public Builder dnsName(String dnsName) {
124123
this.dnsName = checkNotNull(dnsName);
125124
return this;
126125
}
127126

128127
/**
129-
* Sets a mandatory description for this managed zone. The value is a string of at most 1024
130-
* characters which has no effect on the managed zone's function.
128+
* Sets a mandatory description for this zone. The value is a string of at most 1024 characters
129+
* which has no effect on the zone's function.
131130
*/
132131
public Builder description(String description) {
133132
this.description = checkNotNull(description);
134133
return this;
135134
}
136135

137136
/**
138-
* Optionally specifies the NameServerSet for this managed zone. A NameServerSet is a set of DNS
139-
* name servers that all host the same ManagedZones. Most users will not need to specify this
140-
* value.
137+
* Optionally specifies the NameServerSet for this zone. A NameServerSet is a set of DNS name
138+
* servers that all host the same zones. Most users will not need to specify this value.
141139
*/
142140
public Builder nameServerSet(String nameServerSet) {
143141
// todo(mderka) add more to the doc when questions are answered by the service owner
@@ -146,8 +144,8 @@ public Builder nameServerSet(String nameServerSet) {
146144
}
147145

148146
/**
149-
* Sets a list of servers that hold the information about the managed zone. This information is
150-
* provided by Google Cloud DNS and is read only.
147+
* Sets a list of servers that hold the information about the zone. This information is provided
148+
* by Google Cloud DNS and is read only.
151149
*/
152150
Builder nameServers(List<String> nameServers) {
153151
checkNotNull(nameServers);
@@ -156,14 +154,14 @@ Builder nameServers(List<String> nameServers) {
156154
}
157155

158156
/**
159-
* Builds the instance of {@code ManagedZoneInfo} based on the information set by this builder.
157+
* Builds the instance of {@code ZoneInfo} based on the information set by this builder.
160158
*/
161-
public ManagedZoneInfo build() {
162-
return new ManagedZoneInfo(this);
159+
public ZoneInfo build() {
160+
return new ZoneInfo(this);
163161
}
164162
}
165163

166-
private ManagedZoneInfo(Builder builder) {
164+
private ZoneInfo(Builder builder) {
167165
this.name = builder.name;
168166
this.id = builder.id;
169167
this.creationTimeMillis = builder.creationTimeMillis;
@@ -174,80 +172,78 @@ private ManagedZoneInfo(Builder builder) {
174172
}
175173

176174
/**
177-
* Returns a builder for {@code ManagedZoneInfo} with an assigned {@code name}.
175+
* Returns a builder for {@code ZoneInfo} with an assigned {@code name}.
178176
*/
179177
public static Builder builder(String name) {
180178
return new Builder(name);
181179
}
182180

183181
/**
184-
* Returns a builder for {@code ManagedZoneInfo} with an assigned {@code id}.
182+
* Returns a builder for {@code ZoneInfo} with an assigned {@code id}.
185183
*/
186184
public static Builder builder(BigInteger id) {
187185
return new Builder(id);
188186
}
189187

190188
/**
191-
* Returns a builder for {@code ManagedZoneInfo} with an assigned {@code name} and {@code id}.
189+
* Returns a builder for {@code ZoneInfo} with an assigned {@code name} and {@code id}.
192190
*/
193191
public static Builder builder(String name, BigInteger id) {
194192
return new Builder(name, id);
195193
}
196194

197195
/**
198-
* Returns the user-defined name of the managed zone.
196+
* Returns the user-defined name of the zone.
199197
*/
200198
public String name() {
201199
return name;
202200
}
203201

204202
/**
205-
* Returns the read-only managed zone id assigned by the server.
203+
* Returns the read-only zone id assigned by the server.
206204
*/
207205
public BigInteger id() {
208206
return id;
209207
}
210208

211209
/**
212-
* Returns the time when this time that this managed zone was created on the server.
210+
* Returns the time when this time that this zone was created on the server.
213211
*/
214212
public Long creationTimeMillis() {
215213
return creationTimeMillis;
216214
}
217215

218216
/**
219-
* Returns the DNS name of this managed zone, for instance "example.com.".
217+
* Returns the DNS name of this zone, for instance "example.com.".
220218
*/
221219
public String dnsName() {
222220
return dnsName;
223221
}
224222

225223
/**
226-
* Returns the description of this managed zone.
224+
* Returns the description of this zone.
227225
*/
228226
public String description() {
229227
return description;
230228
}
231229

232230
/**
233-
* Returns the optionally specified set of DNS name servers that all host this managed zone.
231+
* Returns the optionally specified set of DNS name servers that all host this zone.
234232
*/
235233
public String nameServerSet() {
236234
// todo(mderka) update this doc after finding out more about this from the service owners
237235
return nameServerSet;
238236
}
239237

240238
/**
241-
* The nameservers that the managed zone should be delegated to. This is defined by the Google DNS
242-
* cloud.
239+
* The nameservers that the zone should be delegated to. This is defined by the Google DNS cloud.
243240
*/
244241
public List<String> nameServers() {
245242
return nameServers;
246243
}
247244

248245
/**
249-
* Returns a builder for {@code ManagedZoneInfo} prepopulated with the metadata of this managed
250-
* zone.
246+
* Returns a builder for {@code ZoneInfo} prepopulated with the metadata of this zone.
251247
*/
252248
public Builder toBuilder() {
253249
return new Builder(this);
@@ -272,35 +268,35 @@ com.google.api.services.dns.model.ManagedZone toPb() {
272268
return pb;
273269
}
274270

275-
static ManagedZoneInfo fromPb(com.google.api.services.dns.model.ManagedZone pb) {
276-
Builder b = new Builder();
271+
static ZoneInfo fromPb(com.google.api.services.dns.model.ManagedZone pb) {
272+
Builder builder = new Builder();
277273
if (pb.getDescription() != null) {
278-
b.description(pb.getDescription());
274+
builder.description(pb.getDescription());
279275
}
280276
if (pb.getDnsName() != null) {
281-
b.dnsName(pb.getDnsName());
277+
builder.dnsName(pb.getDnsName());
282278
}
283279
if (pb.getId() != null) {
284-
b.id(pb.getId());
280+
builder.id(pb.getId());
285281
}
286282
if (pb.getName() != null) {
287-
b.name(pb.getName());
283+
builder.name(pb.getName());
288284
}
289285
if (pb.getNameServers() != null) {
290-
b.nameServers(pb.getNameServers());
286+
builder.nameServers(pb.getNameServers());
291287
}
292288
if (pb.getNameServerSet() != null) {
293-
b.nameServerSet(pb.getNameServerSet());
289+
builder.nameServerSet(pb.getNameServerSet());
294290
}
295291
if (pb.getCreationTime() != null) {
296-
b.creationTimeMillis(DateTime.parse(pb.getCreationTime()).getMillis());
292+
builder.creationTimeMillis(DateTime.parse(pb.getCreationTime()).getMillis());
297293
}
298-
return b.build();
294+
return builder.build();
299295
}
300296

301297
@Override
302298
public boolean equals(Object obj) {
303-
return obj instanceof ManagedZoneInfo && Objects.equals(toPb(), ((ManagedZoneInfo) obj).toPb());
299+
return obj instanceof ZoneInfo && Objects.equals(toPb(), ((ZoneInfo) obj).toPb());
304300
}
305301

306302
@Override

0 commit comments

Comments
 (0)