1 package org.onap.sdc.dcae.rule.editor.translators;
3 import org.onap.sdc.common.onaplog.Enums.LogLevel;
6 import org.onap.sdc.dcae.composition.restmodels.ruleeditor.DateFormatterAction;
8 public class DateFormatterTranslator extends CopyActionTranslator<DateFormatterAction> {
10 private static DateFormatterTranslator dateFormatterTranslator = new DateFormatterTranslator();
12 public static DateFormatterTranslator getInstance() {
13 return dateFormatterTranslator;
16 private DateFormatterTranslator(){}
18 private class DateFormatterTranslation extends ProcessorTranslation {
19 private String fromFormat;
20 private String fromTz;
21 private String toField;
22 private String toFormat;
26 private DateFormatterTranslation(DateFormatterAction action){
27 clazz = "DateFormatter";
28 fromFormat = action.getFromFormat();
29 fromTz = action.getFromTz();
30 toField = action.getTarget();
31 toFormat = action.getToFormat();
32 toTz = action.getToTz();
33 value = action.getFromValue();
38 public boolean addToHpJsonProcessors(DateFormatterAction action, List<Translation> processors, boolean asNewProcessor) {
39 debugLogger.log(LogLevel.DEBUG, this.getClass().getName(), "Translating date formatter action");
40 addToHpJsonProcessors(action, processors);
45 public Translation translateToHpJson(DateFormatterAction action){
46 return new DateFormatterTranslation(action);