blob: 1f988ee696efdbd4f5f27dc70261ac2c583533ed (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision;
import ai.vespa.validation.PatternedStringWrapper;
import java.util.regex.Pattern;
/**
* Identifies an account in a public cloud, such as {@link CloudName#AWS} or {@link CloudName#GCP}.
*
* @author mpolden
*/
public class CloudAccount extends PatternedStringWrapper<CloudAccount> {
public static final CloudAccount empty = new CloudAccount("");
public CloudAccount(String value) {
super(value, Pattern.compile("^([0-9]{12})?$"), "cloud account");
}
public boolean isEmpty() {
return this.equals(empty);
}
@Override
public String toString() {
return isEmpty() ? "unspecified account" : "account '" + value() + "'";
}
}
|