mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Replace command.applyTo() with inlined builder operations
These are much easier to understand. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137446273
This commit is contained in:
parent
b84d7f1fb5
commit
1dbc5f6bb0
28 changed files with 489 additions and 426 deletions
|
@ -65,12 +65,18 @@ public final class ContactCreateFlow extends Flow implements TransactionalFlow {
|
|||
validateClientIsLoggedIn(clientId);
|
||||
Create command = (Create) resourceCommand;
|
||||
verifyResourceDoesNotExist(ContactResource.class, targetId, now);
|
||||
Builder builder = new Builder();
|
||||
command.applyTo(builder);
|
||||
ContactResource newContact = builder
|
||||
ContactResource newContact = new Builder()
|
||||
.setContactId(targetId)
|
||||
.setAuthInfo(command.getAuthInfo())
|
||||
.setCreationClientId(clientId)
|
||||
.setCurrentSponsorClientId(clientId)
|
||||
.setRepoId(createContactHostRoid(ObjectifyService.allocateId()))
|
||||
.setFaxNumber(command.getFax())
|
||||
.setVoiceNumber(command.getVoice())
|
||||
.setDisclose(command.getDisclose())
|
||||
.setEmailAddress(command.getEmail())
|
||||
.setInternationalizedPostalInfo(command.getInternationalizedPostalInfo())
|
||||
.setLocalizedPostalInfo(command.getLocalizedPostalInfo())
|
||||
.build();
|
||||
validateAsciiPostalInfo(newContact.getInternationalizedPostalInfo());
|
||||
validateContactAgainstPolicy(newContact);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue