1 package org.onap.sdc.dcae.rule.editor.translators;
3 import com.google.gson.annotations.SerializedName;
4 import org.onap.sdc.common.onaplog.OnapLoggerDebug;
5 import org.onap.sdc.common.onaplog.OnapLoggerError;
7 import java.util.ArrayList;
10 public interface IRuleElementTranslator<T> {
12 OnapLoggerError errLogger = OnapLoggerError.getInstance();
13 OnapLoggerDebug debugLogger = OnapLoggerDebug.getInstance();
15 Translation translateToHpJson(T element);
17 abstract class Translation {
20 class ProcessorTranslation extends Translation {
21 @SerializedName("class")
22 protected String clazz;
26 class FiltersTranslation extends ProcessorTranslation {
27 protected List<Translation> filters;
29 protected FiltersTranslation(String clazz, List<Translation> filters) {
31 this.filters = filters;
35 class RuleTranslation extends Translation {
36 protected String phase;
37 protected Translation filter;
38 protected List<Translation> processors = new ArrayList<>();
41 class RunPhaseProcessorsTranslation extends ProcessorTranslation {
42 protected String phase;
44 protected RunPhaseProcessorsTranslation(String runPhase){