diff options
author | Håkon Hallingstad <hakon@yahooinc.com> | 2023-01-13 15:48:12 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahooinc.com> | 2023-01-13 15:48:12 +0100 |
commit | 428c1208f11074ca48e4b8a421ab69a866423ae1 (patch) | |
tree | 39dc3cc8cc72e232c92154bb5ed2cbed400dd009 /config-provisioning | |
parent | b45d75179d6c12025ace97c71fdca251146a8e42 (diff) |
Return void
Diffstat (limited to 'config-provisioning')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/CloudAccount.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/CloudAccount.java b/config-provisioning/src/main/java/com/yahoo/config/provision/CloudAccount.java index 677803f9394..215afbca255 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/CloudAccount.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/CloudAccount.java @@ -22,16 +22,14 @@ public class CloudAccount extends PatternedStringWrapper<CloudAccount> { /** Empty value. When this is used, either implicitly or explicitly, the zone will use its default account */ public static final CloudAccount empty = new CloudAccount("", EMPTY, "cloud account"); - /** Verifies accountId is a valid AWS account ID and return it unaltered, or throw an IllegalArgumentException. */ - public static String requireAwsAccountId(String accountId) { + /** Verifies accountId is a valid AWS account ID, or throw an IllegalArgumentException. */ + public static void requireAwsAccountId(String accountId) { Validation.requireMatch(accountId, "AWS account ID", AWS_ACCOUNT_ID_PATTERN); - return accountId; } - /** Verifies accountId is a valid GCP project ID and return it unaltered, or throw an IllegalArgumentException. */ - public static String requireGcpProjectId(String projectId) { + /** Verifies accountId is a valid GCP project ID, or throw an IllegalArgumentException. */ + public static void requireGcpProjectId(String projectId) { Validation.requireMatch(projectId, "GCP project ID", GCP_PROJECT_ID_PATTERN); - return projectId; } private CloudAccount(String value, String regex, String description) { @@ -49,16 +47,14 @@ public class CloudAccount extends PatternedStringWrapper<CloudAccount> { !equals(zone.cloud().account()); } - /** Verifies this account is a valid AWS account ID and return this, or throw an IllegalArgumentException. */ - public CloudAccount requireAwsAccountId() { + /** Verifies this account is a valid AWS account ID, or throw an IllegalArgumentException. */ + public void requireAwsAccountId() { requireAwsAccountId(value()); - return this; } - /** Verifies this account is a valid GCP project ID and return this, or throw an IllegalArgumentException. */ - public CloudAccount requireGcpProjectId() { + /** Verifies this account is a valid GCP project ID, or throw an IllegalArgumentException. */ + public void requireGcpProjectId() { requireGcpProjectId(value()); - return this; } public static CloudAccount from(String cloudAccount) { |