Package com.google.cloud.tools.project
Class ProjectIdValidator
- java.lang.Object
-
- com.google.cloud.tools.project.ProjectIdValidator
-
public class ProjectIdValidator extends Object
Check if a string is a legal Google Cloud Platform Project ID. Source: com.google.apphosting.base.AppIdproject-id ::= [(partition)~][(domain):](display-project-id) partition ::= [a-z\d\-\.]{1,100} domain ::= r'(?!-)[a-z\d\-\.]{1,100}' display-project-id ::= r'(?!-)[a-z\d\-]{1,100}'
Note that in some older documentation this is referred to as an "application ID."
-
-
Constructor Summary
Constructors Constructor Description ProjectIdValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
validate(String id)
Check whether a string is a syntactically correct project ID.
-
-
-
Method Detail
-
validate
public static boolean validate(@Nullable String id)
Check whether a string is a syntactically correct project ID. This method only checks syntax. It does not check that the ID actually identifies a project in the Google Cloud Platform.- Parameters:
id
- the alleged project ID- Returns:
- true if it's correct, false otherwise
-
-