Skip to content

Commit 3d8e4c0

Browse files
committed
Removed unnecessary imports.
1 parent 729201c commit 3d8e4c0

6 files changed

Lines changed: 16 additions & 11 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ Zone zone = dns.create(zoneInfo);
252252
The second snippet shows how to create records inside a zone. The complete code can be found on [CreateOrUpdateRecordSets.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/CreateOrUpdateRecordSets.java).
253253
254254
```java
255-
import com.google.gcloud.dns.ChangeRequest;
256255
import com.google.gcloud.dns.ChangeRequestInfo;
257256
import com.google.gcloud.dns.Dns;
258257
import com.google.gcloud.dns.DnsOptions;

gcloud-java-dns/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ our zone that creates a record set of type A and points URL www.someexampledomai
159159
IP address 12.13.14.15. Start by adding
160160

161161
```java
162-
import com.google.gcloud.dns.ChangeRequest;
163162
import com.google.gcloud.dns.ChangeRequestInfo;
164163
import com.google.gcloud.dns.RecordSet;
165164

@@ -221,7 +220,7 @@ When the change request is applied, it is registered with the Cloud DNS service
221220
can wait for its completion as follows:
222221

223222
```java
224-
while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
223+
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
225224
try {
226225
Thread.sleep(500L);
227226
} catch (InterruptedException e) {
@@ -263,9 +262,17 @@ while (recordSetIterator.hasNext()) {
263262
}
264263
```
265264

266-
You can also list the history of change requests that were applied to a zone:
265+
You can also list the history of change requests that were applied to a zone.
266+
First add:
267267

268268
```java
269+
import java.util.ChangeRequest;
270+
```
271+
272+
and then:
273+
274+
```java
275+
269276
// List the change requests applied to a particular zone
270277
Iterator<ChangeRequest> changeIterator = zone.listChangeRequests().iterateAll();
271278
System.out.println(String.format("The history of changes in %s:", zone.name()));
@@ -298,7 +305,7 @@ if (!changeRequest.deletions().isEmpty()) {
298305
// Wait for change to finish, but save data traffic by transferring only ID and status
299306
Dns.ChangeRequestOption option =
300307
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS);
301-
while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
308+
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
302309
System.out.println("Waiting for change to complete. Going to sleep for 500ms...");
303310
try {
304311
Thread.sleep(500);

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,14 @@ public Builder toBuilder() {
161161

162162
@Override
163163
public boolean equals(Object obj) {
164-
if (obj.getClass().equals(ChangeRequest.class)) {
164+
if (obj == null || !obj.getClass().equals(ChangeRequest.class)) {
165+
return false
166+
} else {
165167
ChangeRequest other = (ChangeRequest) obj;
166168
return Objects.equals(options, other.options)
167169
&& Objects.equals(zone, other.zone)
168170
&& Objects.equals(toPb(), other.toPb());
169171
}
170-
return false;
171172
}
172173

173174
@Override

gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/CreateOrUpdateRecordSets.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
package com.google.gcloud.examples.dns.snippets;
2424

25-
import com.google.gcloud.dns.ChangeRequest;
2625
import com.google.gcloud.dns.ChangeRequestInfo;
2726
import com.google.gcloud.dns.Dns;
2827
import com.google.gcloud.dns.DnsOptions;

gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/DeleteZone.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
package com.google.gcloud.examples.dns.snippets;
2424

25-
import com.google.gcloud.dns.ChangeRequest;
2625
import com.google.gcloud.dns.ChangeRequestInfo;
2726
import com.google.gcloud.dns.Dns;
2827
import com.google.gcloud.dns.DnsOptions;
@@ -65,7 +64,7 @@ public static void main(String... args) {
6564
// Wait for change to finish, but save data traffic by transferring only ID and status
6665
Dns.ChangeRequestOption option =
6766
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS);
68-
while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
67+
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
6968
System.out.println("Waiting for change to complete. Going to sleep for 500ms...");
7069
try {
7170
Thread.sleep(500);

gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/ManipulateZonesAndRecordSets.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static void main(String... args) {
8383
ChangeRequestInfo changeRequest = changeBuilder.build();
8484
zone.applyChangeRequest(changeRequest);
8585

86-
while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
86+
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
8787
try {
8888
Thread.sleep(500L);
8989
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)