Modify std pap policy to use builder in constr
[policy/engine.git] / ONAP-XACML / src / main / java / org / onap / policy / xacml / std / pap / StdPAPPolicyParams.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP-XACML
4  * ================================================================================
5  * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.xacml.std.pap;
22
23 import java.util.List;
24 import java.util.Map;
25
26 /**
27  * Std PAP Policy paramters class.
28  */
29 public class StdPAPPolicyParams {
30     private String configPolicyType;
31     private String policyName;
32     private String description;
33     private String onapName;
34     private String configName;
35     private Map<String, String> dyanamicFieldConfigAttributes;
36     private String configType;
37     private String configBodyData;
38     private Boolean editPolicy;
39     private String domain;
40     private String riskLevel;
41     private String riskType;
42     private String guard;
43     private String ttlDate;
44     private int highestVersion;
45     private List<String> dynamicRuleAlgorithmLabels;
46     private List<String> dynamicRuleAlgorithmCombo;
47     private List<String> dynamicRuleAlgorithmField1;
48     private List<String> dynamicRuleAlgorithmField2;
49     private String actionPerformer;
50     private String actionAttribute;
51     private String providerComboBox;
52     private Map<String, String> dynamicSettingsMap;
53     private List<Object> dynamicVariableList;
54     private List<String> dataTypeList;
55     private Map<String, String> dropDownMap;
56     private Map<String,String> treatments;
57
58     /**
59      * Default constructor
60      */
61     private StdPAPPolicyParams() {
62         super();
63     }
64
65     public int getHighestVersion() {
66         return highestVersion;
67     }
68
69     public static StdPAPPolicyParamsBuilder builder() {
70         return new StdPAPPolicyParamsBuilder();
71     }
72
73     public String getConfigPolicyType() {
74         return configPolicyType;
75     }
76
77     public String getPolicyName() {
78         return policyName;
79     }
80
81     public String getDescription() {
82         return description;
83     }
84
85     public String getOnapName() {
86         return onapName;
87     }
88
89     public String getConfigName() {
90         return configName;
91     }
92
93     public Map<String, String> getDyanamicFieldConfigAttributes() {
94         return dyanamicFieldConfigAttributes;
95     }
96
97     public String getConfigType() {
98         return configType;
99     }
100
101     public String getConfigBodyData() {
102         return configBodyData;
103     }
104
105     public Boolean getEditPolicy() {
106         return editPolicy;
107     }
108
109     public String getDomain() {
110         return domain;
111     }
112
113     public String getRiskLevel() {
114         return riskLevel;
115     }
116
117     public String getRiskType() {
118         return riskType;
119     }
120
121     public String getGuard() {
122         return guard;
123     }
124
125     public String getTtlDate() {
126         return ttlDate;
127     }
128
129     public List<String> getDynamicRuleAlgorithmLabels() {
130         return dynamicRuleAlgorithmLabels;
131     }
132
133     public List<String> getDynamicRuleAlgorithmCombo() {
134         return dynamicRuleAlgorithmCombo;
135     }
136
137     public List<String> getDynamicRuleAlgorithmField1() {
138         return dynamicRuleAlgorithmField1;
139     }
140
141     public List<String> getDynamicRuleAlgorithmField2() {
142         return dynamicRuleAlgorithmField2;
143     }
144
145     public String getActionPerformer() {
146         return actionPerformer;
147     }
148
149     public String getActionAttribute() {
150         return actionAttribute;
151     }
152
153     public String getProviderComboBox() {
154         return providerComboBox;
155     }
156
157     public Map<String,String> getDynamicSettingsMap() {
158         return dynamicSettingsMap;
159     }
160
161     public List<Object> getDynamicVariableList() {
162         return dynamicVariableList;
163     }
164
165     public List<String> getDataTypeList() {
166         return dataTypeList;
167     }
168
169     public Map<String,String> getDropDownMap() {
170         return dropDownMap;
171     }
172
173     public Map<String,String> getTreatments() {
174         return treatments;
175     }
176
177     /**
178      * Builder class for the Policy parameters
179      */
180     public static class StdPAPPolicyParamsBuilder {
181         StdPAPPolicyParams m = new StdPAPPolicyParams();
182
183         public StdPAPPolicyParams build() {
184             return m;
185         }
186
187         public StdPAPPolicyParamsBuilder configPolicyType(String configPolicyType) {
188             m.configPolicyType = configPolicyType;
189             return this;
190         }
191
192
193         public StdPAPPolicyParamsBuilder policyName(String policyName) {
194             m.policyName = policyName;
195             return this;
196         }
197
198         public StdPAPPolicyParamsBuilder description(String description) {
199             m.description = description;
200             return this;
201         }
202
203         public StdPAPPolicyParamsBuilder onapName(String onapName) {
204             m.onapName = onapName;
205             return this;
206         }
207
208         public StdPAPPolicyParamsBuilder configName(String configName) {
209             m.configName = configName;
210             return this;
211         }
212
213         public StdPAPPolicyParamsBuilder dyanamicFieldConfigAttributes(Map<String, String> attributes) {
214             m.dyanamicFieldConfigAttributes = attributes;
215             return this;
216         }
217
218         public StdPAPPolicyParamsBuilder configType(String configType) {
219             m.configType = configType;
220             return this;
221         }
222
223         public StdPAPPolicyParamsBuilder configBodyData(String body) {
224             m.configBodyData = body;
225             return this;
226         }
227
228         public StdPAPPolicyParamsBuilder editPolicy(boolean editPolicy) {
229             m.editPolicy = editPolicy;
230             return this;
231         }
232
233         public StdPAPPolicyParamsBuilder domain(String domain) {
234             m.domain = domain;
235             return this;
236         }
237
238         public StdPAPPolicyParamsBuilder riskLevel(String riskLevel) {
239             m.riskLevel = riskLevel;
240             return this;
241         }
242
243         public StdPAPPolicyParamsBuilder riskType(String riskType) {
244             m.riskType = riskType;
245             return this;
246         }
247
248         public StdPAPPolicyParamsBuilder guard(String guard) {
249             m.guard = guard;
250             return this;
251         }
252
253         public StdPAPPolicyParamsBuilder ttlDate(String ttlDate) {
254             m.ttlDate = ttlDate;
255             return this;
256         }
257
258         public StdPAPPolicyParamsBuilder highestVersion(int highVer) {
259             m.highestVersion = highVer;
260             return this;
261         }
262
263         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmLabels(List<String> dynamicRuleAlgorithmLabels) {
264             m.dynamicRuleAlgorithmLabels = dynamicRuleAlgorithmLabels;
265             return this;
266         }
267
268         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmCombo(List<String> dynamicRuleAlgorithmCombo) {
269             m.dynamicRuleAlgorithmCombo = dynamicRuleAlgorithmCombo;
270             return this;
271         }
272
273         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmField1(List<String> dynamicRuleAlgorithmField1) {
274             m.dynamicRuleAlgorithmField1 = dynamicRuleAlgorithmField1;
275             return this;
276         }
277
278         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmField2(List<String> dynamicRuleAlgorithmField2) {
279             m.dynamicRuleAlgorithmField2 = dynamicRuleAlgorithmField2;
280             return this;
281         }
282
283         public StdPAPPolicyParamsBuilder actionPerformer(String actionPerformer) {
284             m.actionPerformer = actionPerformer;
285             return this;
286         }
287
288         public StdPAPPolicyParamsBuilder actionAttribute(String actionAttribute) {
289             m.actionAttribute = actionAttribute;
290             return this;
291         }
292
293         public StdPAPPolicyParamsBuilder providerComboBox(String providerComboBox) {
294             m.providerComboBox = providerComboBox;
295             return this;
296         }
297
298         public StdPAPPolicyParamsBuilder dynamicVariableList(List<Object> dynamicVariableList) {
299             m.dynamicVariableList = dynamicVariableList;
300             return this;
301         }
302
303         public StdPAPPolicyParamsBuilder dynamicSettingsMap(Map<String, String> dynamicSettingsMap) {
304             m.dynamicSettingsMap = dynamicSettingsMap;
305             return this;
306         }
307
308         public StdPAPPolicyParamsBuilder dataTypeList(List<String> dataTypeList) {
309             m.dataTypeList = dataTypeList;
310             return this;
311         }
312
313         public StdPAPPolicyParamsBuilder dropDownMap(Map<String, String> dropDownMap){
314             m.dropDownMap = dropDownMap;
315             return this;
316         }
317
318         public StdPAPPolicyParamsBuilder treatments(Map<String,String> treatments) {
319             m.treatments = treatments;
320             return this;
321         }
322     }
323 }