class ServiceNameValidator implements ParameterValidator {

    @Override
    public Object attemptToCorrect(Object serviceName, final Map<String, Object> relatedParameters) {
        if (!(serviceName instanceof String)) {
            throw new ContentException(Messages.COULD_NOT_CREATE_VALID_SERVICE_NAME_FROM_0, serviceName);
        }

        boolean applyNamespaceLocal = MapUtil.parseBooleanFlag(relatedParameters, SupportedParameters.APPLY_NAMESPACE, true);
        boolean applyNamespace = applyNamespaceGlobal && applyNamespaceLocal;

        return NameUtil.computeValidServiceName((String) serviceName, namespace, applyNamespace);
    }

    public  ServiceNameValidator(String namespace, boolean applyNamespace);

}