From 428c1208f11074ca48e4b8a421ab69a866423ae1 Mon Sep 17 00:00:00 2001 From: HÃ¥kon Hallingstad Date: Fri, 13 Jan 2023 15:48:12 +0100 Subject: Return void --- .../com/yahoo/config/provision/CloudAccount.java | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'config-provisioning/src') 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 { /** 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 { !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) { -- cgit v1.2.3