public MetricNameBuilder addNameToken(String nameToken) throws MetricsNameSyntaxException {
        nameToken = nameToken.trim();
        if (!nameToken.matches(VALID_NAME_TOKEN_RGX)) {
            throw new MetricsNameSyntaxException("Name must match " + VALID_NAME_TOKEN_RGX);
        }

        this.names.add(nameToken);
        return this;
    }
public MetricNameBuilder addNameToken ( String nameToken ) throws MetricsNameSyntaxException { nameToken = nameToken . trim ( ) ; if ( ! nameToken . matches ( VALID_NAME_TOKEN_RGX ) ) { throw new MetricsNameSyntaxException ( "Name must match " + VALID_NAME_TOKEN_RGX ) ; } this . names . add ( nameToken ) ; return this ; }
@param nameToken must be a single valid name segment which is summarized by the regex
{@link CloudWatchReporter#VALID_NAME_TOKEN_RGX} (it may end in the permute operator).
@return this for chaining
@throws MetricsNameSyntaxException on validation failure