Skip to content

Commit

Permalink
Moved Status enum to ChangeRequestInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
mderka committed Mar 25, 2016
1 parent 5c5ed78 commit d47cc99
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ public class ChangeRequest extends ChangeRequestInfo {
private final String zoneName;
private transient Dns dns;

/**
* This enumerates the possible states of a {@code ChangeRequest}.
*
* @see <a href="https://cloud.google.com/dns/api/v1/changes#resource">Google Cloud DNS
* documentation</a>
*/
public enum Status {
PENDING,
DONE
}

/**
* A builder for {@code ChangeRequest}s.
*/
Expand Down Expand Up @@ -179,9 +168,10 @@ public Builder toBuilder() {

@Override
public boolean equals(Object obj) {
return obj instanceof ChangeRequest && Objects.equals(toPb(), ((ChangeRequest) obj).toPb())
return obj instanceof ChangeRequest
&& Objects.equals(options, ((ChangeRequest) obj).options)
&& Objects.equals(zoneName, ((ChangeRequest) obj).zoneName);
&& Objects.equals(zoneName, ((ChangeRequest) obj).zoneName)
&& Objects.equals(toPb(), ((ChangeRequest) obj).toPb());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ public ChangeRequestInfo apply(Change pb) {
private final List<RecordSet> deletions;
private final String id;
private final Long startTimeMillis;
private final ChangeRequest.Status status;
private final ChangeRequestInfo.Status status;

/**
* This enumerates the possible states of a change request.
*
* @see <a href="https://cloud.google.com/dns/api/v1/changes#resource">Google Cloud DNS
* documentation</a>
*/
public enum Status {
PENDING,
DONE
}

/**
* A builder for {@code ChangeRequestInfo}.
Expand Down Expand Up @@ -110,7 +121,7 @@ public abstract static class Builder {
/**
* Associates a server-assigned id to this {@code ChangeRequestInfo}.
*/
abstract Builder id(String id);
abstract Builder id(String id);

/**
* Sets the time when this change request was started by a server.
Expand All @@ -134,7 +145,7 @@ static class BuilderImpl extends Builder {
private List<RecordSet> deletions;
private String id;
private Long startTimeMillis;
private ChangeRequest.Status status;
private ChangeRequestInfo.Status status;

BuilderImpl() {
this.additions = new LinkedList<>();
Expand Down Expand Up @@ -215,7 +226,7 @@ Builder startTimeMillis(long startTimeMillis) {
}

@Override
Builder status(ChangeRequest.Status status) {
Builder status(ChangeRequestInfo.Status status) {
this.status = checkNotNull(status);
return this;
}
Expand Down Expand Up @@ -276,7 +287,7 @@ public Long startTimeMillis() {
/**
* Returns the status of this {@code ChangeRequest}.
*/
public ChangeRequest.Status status() {
public ChangeRequestInfo.Status status() {
return status;
}

Expand Down

0 comments on commit d47cc99

Please sign in to comment.