blob: 96393dd8fcef63872d29b7a2bbcc8a518de8c1bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package org.onap.sdc.dcae.rule.editor.validators;
import org.onap.sdc.dcae.composition.restmodels.ruleeditor.LogEventAction;
import org.onap.sdc.dcae.errormng.ActionStatus;
import org.onap.sdc.dcae.errormng.ErrConfMgr;
import org.onap.sdc.dcae.errormng.ResponseFormat;
import org.onap.sdc.dcae.rule.editor.utils.ValidationUtils;
import java.util.List;
public class LogEventValidator extends BaseActionValidator<LogEventAction> {
private static LogEventValidator logEventValidator = new LogEventValidator();
public static LogEventValidator getInstance() {
return logEventValidator;
}
private LogEventValidator(){}
@Override
public boolean validate(LogEventAction action, List<ResponseFormat> errors) {
if(!ValidationUtils.validateNotEmpty(action.logTitle())){
errors.add(ErrConfMgr.INSTANCE.getResponseFormat(ActionStatus.MISSING_ACTION_FIELD, null, "title", action.getActionType(), action.strippedTarget()));
return false;
}
return super.validate(action, errors);
}
}
|