Clarify the relationship between project ids in RegistryConfigs

This makes it clear that the non-production environment project ids are all
constructed by adding a suffix to the production environment project id, and
makes it slightly easier to configure it for a new environment (because there is
only one string to change instead of two).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135406763
This commit is contained in:
mcilwain 2016-07-20 14:40:24 -04:00 committed by Ben McIlwain
parent d4e4333c2e
commit 64426d3c7c

View file

@ -53,11 +53,12 @@ public final class ProductionRegistryConfigExample implements RegistryConfig {
@Override @Override
public String getProjectId() { public String getProjectId() {
String prodProjectId = "domain-registry";
switch (environment) { switch (environment) {
case PRODUCTION: case PRODUCTION:
return "domain-registry"; return prodProjectId;
default: default:
return "domain-registry-" + Ascii.toLowerCase(environment.name()); return prodProjectId + "-" + Ascii.toLowerCase(environment.name());
} }
} }