class AmountValidator {

    public void validateAmount(String amount, MessageError messageError) {
        if (amount == null) {
            errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_NULL_VALUE, AMOUNT_STRING));
        } else if (StringUtils.isBlank(amount)) {
            errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_EMPTY_FIELD, AMOUNT_STRING));
        } else if (!Pattern.matches(CORRECT_AMOUNT_REGEX, amount)) {
            errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_WRONG_FORMAT_VALUE, AMOUNT_STRING));
        }
    }

}