import fj.data.Either;
import java.util.List;
+import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
result = valueValidRes.right().value();
} else {
String newValue = valueValidRes.left().value();
- if (log.isTraceEnabled()) {
- if (value != null && !value.equals(newValue)) {
- log.trace("The additional information value was normalized from {} to {}", value, newValue);
- }
+ if (log.isTraceEnabled() && (value != null && !value.equals(newValue))) {
+ log.trace("The additional information value was normalized from {} to {}", value, newValue);
}
additionalInfoParameterInfo.setValue(newValue);
}
* @return
*/
private Either<String, ResponseFormat> validateValue(String value) {
- boolean isNonEmptyString = ValidationUtils.validateStringNotEmpty(value);
- if (!isNonEmptyString) {
+ if (StringUtils.isEmpty(value)) {
return Either.right(componentsUtils.getResponseFormatAdditionalProperty(ActionStatus.ADDITIONAL_INFORMATION_EMPTY_STRING_NOT_ALLOWED));
}
boolean valid = StringValidator.getInstance().isValid(value, null);
AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo();
additionalInfoParameterInfo.setKey(key);
String normKey = ValidationUtils.normalizeAdditionalInformation(key);
- boolean isNonEmptyString = ValidationUtils.validateStringNotEmpty(normKey);
- if (!isNonEmptyString) {
+ if (StringUtils.isEmpty(normKey)) {
return Either.right(componentsUtils
.getResponseFormatAdditionalProperty(ActionStatus.ADDITIONAL_INFORMATION_EMPTY_STRING_NOT_ALLOWED, null, null,
AdditionalInformationEnum.Label));