class HeadersLengthValidatorImpl extends AbstractHeaderValidatorImpl implements ConsentHeaderValidator, PaymentHeaderValidator {

    @Override
    public MessageError validate(Map<String, String> inputHeaders, MessageError messageError) {
        for (Map.Entry<String, String> header : inputHeaders.entrySet()) {
            if (isHeaderExceedsLength(header)) {
                errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_OVERSIZE_HEADER, header.getKey(), headerMaxLengths.get(header.getKey())));
            }
        }

        return messageError;
    }

    @Autowired public  HeadersLengthValidatorImpl(ErrorBuildingService errorBuildingService);

}