3232import 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