Rename "clientIdentifier" to "clientId" almost everywhere

It's best to be consistent and use the same thing everywhere.  "clientId" was
already used in more places and is shorter and no more ambiguous, so it's the
logical one to win out.

Note that this CL is almost solely a big Eclipse-assisted refactoring. There are
two places that I did not change clientIdentifier -- the actual entity field on
Registrar (though I did change all getters and setters), and the name of a
column on the exported registrar spreadsheet. Both would require data
migrations.

Also fixes a few minor nits discovered in touched files, including an incorrect
test in OfyFilterTest.java and some superfluous uses of String.format() when
calling checkArgument().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133956465
This commit is contained in:
mcilwain 2016-09-22 08:31:00 -07:00 committed by Ben McIlwain
parent 0564bcdbc9
commit 4813ed392b
62 changed files with 208 additions and 200 deletions

View file

@ -41,7 +41,7 @@ public class BraintreeRegistrarSyncer {
/**
* Syncs {@code registrar} with Braintree customer entry, creating it if one doesn't exist.
*
* <p>The customer ID will be the same as {@link Registrar#getClientIdentifier()}.
* <p>The customer ID will be the same as {@link Registrar#getClientId()}.
*
* <p>Creating a customer object in Braintree's database is a necessary step in order to associate
* a payment with a registrar. The transaction will fail if the customer object doesn't exist.
@ -49,8 +49,8 @@ public class BraintreeRegistrarSyncer {
* @throws IllegalArgumentException if {@code registrar} is not using BRAINTREE billing
* @throws VerifyException if the Braintree API returned a failure response
*/
public void sync(Registrar registrar) throws VerifyException {
String id = registrar.getClientIdentifier();
public void sync(Registrar registrar) {
String id = registrar.getClientId();
checkArgument(registrar.getBillingMethod() == Registrar.BillingMethod.BRAINTREE,
"Registrar (%s) billing method (%s) is not BRAINTREE", id, registrar.getBillingMethod());
CustomerRequest request = createRequest(registrar);
@ -67,8 +67,8 @@ public class BraintreeRegistrarSyncer {
private CustomerRequest createRequest(Registrar registrar) {
CustomerRequest result =
new CustomerRequest()
.id(registrar.getClientIdentifier())
.customerId(registrar.getClientIdentifier())
.id(registrar.getClientId())
.customerId(registrar.getClientId())
.company(registrar.getRegistrarName());
Optional<RegistrarContact> contact = getBillingContact(registrar);
if (contact.isPresent()) {