class SettingService {

    public void validateNewValue(String newValue, SettingDTO settingDefinition) throws BadRequestException {
        if (StringUtils.isEmpty(newValue)) {
            validateRequiredSettingIsPresent(settingDefinition);
            // Do not validate format on a missing value
            return;
        }

        validateSettingTypeFormat(newValue, settingDefinition);
        validateSettingCustomValidator(newValue, settingDefinition);
    }

}