Skip to content

Commit 3becc74

Browse files
committed
Reworded the documentation.
1 parent 52567fd commit 3becc74

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,26 +156,31 @@ public ChangeRequest applyTo(String zoneName, Dns.ChangeRequestOption... options
156156

157157
/**
158158
* Retrieves the up-to-date information about the change request from Google Cloud DNS. Parameter
159-
* {@code options} can be used to restrict the fields to be updated in the same way as in {@link
160-
* Dns#getChangeRequest(String, String, Dns.ChangeRequestOption...)}. If {@code options} are
161-
* provided, any field other than generatedId which is not included in the {@code options} will be
162-
* {@code null} regardless whether they are initialized or not in {@code this} instance.
159+
* {@code options} can be used to restrict the fields to be included in the updated object the
160+
* same way as in {@link Dns#getChangeRequest(String, String, Dns.ChangeRequestOption...)}. If
161+
* {@code options} are provided, any field other than generatedId which is not included in the
162+
* {@code options} will be {@code null} regardless of whether they are initialized or not in
163+
* {@code this} instance.
164+
*
165+
* @return an object containing the updated information
163166
*/
164167
public ChangeRequest reload(Dns.ChangeRequestOption... options) {
165-
return dns.getChangeRequest(zone, this.generatedId(), options);
168+
return dns.getChangeRequest(zone, generatedId(), options);
166169
}
167170

168171
/**
169172
* Returns {@code true} if the change request has been completed. The function makes an API call
170-
* to Google Cloud DNS in order request the status update.
173+
* to Google Cloud DNS in order request the status update only if the status of the change request
174+
* is {@link Status#PENDING}. If the status is already {@link Status#DONE}, the method returns
175+
* {@code true} without an API call.
171176
*/
172177
public boolean isDone() {
173178
if (status() == Status.DONE) {
174179
return true;
175-
} else {
176-
ChangeRequest updated = reload(Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS));
177-
return updated.status() == Status.DONE;
178180
}
181+
ChangeRequest updated = reload(Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS));
182+
return updated.status() == Status.DONE;
183+
179184
}
180185

181186
@Override

0 commit comments

Comments
 (0)