class TppDomainValidator implements BusinessValidator<String> {

    @Override
    public ValidationResult validate(@NotNull String header) {
        if (StringUtils.isNotBlank(header) &&
                isRedirectScaApproach() &&
                isCheckUriComplianceToDomainSupported() &&
                isRejectMode()) {
            List<URL> certificateUrls = getCertificateUrls();

            if (certificateUrls.isEmpty()) {
                return ValidationResult.valid();
            }

            URL urlHeader = buildURL(header);
            if (urlHeader == null || !isUrlCompliant(urlHeader, certificateUrls)) {
                return buildInvalidResult();
            }
        }

        return ValidationResult.valid();
    }

}