Class ProjectIdValidator


  • public class ProjectIdValidator
    extends Object
    Check if a string is a legal Google Cloud Platform Project ID. Source: com.google.apphosting.base.AppId
     project-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 Detail

      • ProjectIdValidator

        public ProjectIdValidator()
    • 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