Skip to content

Commit

Permalink
Rename setters/getters/builders for Compute classes to meet proto con…
Browse files Browse the repository at this point in the history
…ventions
  • Loading branch information
mziccard committed Oct 19, 2016
1 parent 513ca70 commit 728002e
Show file tree
Hide file tree
Showing 116 changed files with 7,758 additions and 3,163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static class Builder extends AddressInfo.Builder {
Builder(Compute compute, AddressId addressId) {
this.compute = compute;
this.infoBuilder = new AddressInfo.BuilderImpl();
this.infoBuilder.addressId(addressId);
this.infoBuilder.setAddressId(addressId);
}

Builder(Address address) {
Expand All @@ -65,44 +65,62 @@ public static class Builder extends AddressInfo.Builder {
}

@Override
@Deprecated
public Builder address(String address) {
infoBuilder.address(address);
return setAddress(address);
}

@Override
public Builder setAddress(String address) {
infoBuilder.setAddress(address);
return this;
}

@Override
Builder creationTimestamp(Long creationTimestamp) {
infoBuilder.creationTimestamp(creationTimestamp);
Builder setCreationTimestamp(Long creationTimestamp) {
infoBuilder.setCreationTimestamp(creationTimestamp);
return this;
}

@Override
@Deprecated
public Builder description(String description) {
infoBuilder.description(description);
return setDescription(description);
}

@Override
public Builder setDescription(String description) {
infoBuilder.setDescription(description);
return this;
}

@Override
Builder generatedId(String generatedId) {
infoBuilder.generatedId(generatedId);
Builder setGeneratedId(String generatedId) {
infoBuilder.setGeneratedId(generatedId);
return this;
}

@Override
@Deprecated
public Builder addressId(AddressId addressId) {
infoBuilder.addressId(addressId);
return setAddressId(addressId);
}

@Override
public Builder setAddressId(AddressId addressId) {
infoBuilder.setAddressId(addressId);
return this;
}

@Override
Builder status(Status status) {
infoBuilder.status(status);
Builder setStatus(Status status) {
infoBuilder.setStatus(status);
return this;
}

@Override
Builder usage(Usage usage) {
infoBuilder.usage(usage);
Builder setUsage(Usage usage) {
infoBuilder.setUsage(usage);
return this;
}

Expand Down Expand Up @@ -137,7 +155,7 @@ public boolean exists() {
* @throws ComputeException upon failure
*/
public Address reload(AddressOption... options) {
return compute.getAddress(addressId(), options);
return compute.getAddress(getAddressId(), options);
}

/**
Expand All @@ -148,13 +166,21 @@ public Address reload(AddressOption... options) {
* @throws ComputeException upon failure
*/
public Operation delete(OperationOption... options) {
return compute.deleteAddress(addressId(), options);
return compute.deleteAddress(getAddressId(), options);
}

/**
* Returns the address's {@code Compute} object used to issue requests.
*/
@Deprecated
public Compute compute() {
return getCompute();
}

/**
* Returns the address's {@code Compute} object used to issue requests.
*/
public Compute getCompute() {
return compute;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ enum Type {
/**
* Returns the type of this address identity.
*/
@Deprecated
public abstract Type type();

/**
* Returns the type of this address identity.
*/
public abstract Type getType();

/**
* Returns the name of the address resource. The name must be 1-63 characters long and comply with
* RFC1035. Specifically, the name must match the regular expression
Expand All @@ -65,7 +71,21 @@ enum Type {
*
* @see <a href="https://www.ietf.org/rfc/rfc1035.txt">RFC1035</a>
*/
@Deprecated
public String address() {
return getAddress();
}

/**
* Returns the name of the address resource. The name must be 1-63 characters long and comply with
* RFC1035. Specifically, the name must match the regular expression
* {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter,
* and all following characters must be a dash, lowercase letter, or digit, except the last
* character, which cannot be a dash.
*
* @see <a href="https://www.ietf.org/rfc/rfc1035.txt">RFC1035</a>
*/
public String getAddress() {
return address;
}

Expand Down
Loading

0 comments on commit 728002e

Please sign in to comment.