Use builder for std pap policy
[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> dynamicFieldConfigAttributes;
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     private String policyID;
58     private String ruleID;
59     private String version;
60     private String jsonBody;
61     private String brmsController;
62     private List<String> brmsDependency;
63     private Map<String,String> drlRuleAndUIParams;
64     private boolean draft;
65     private String oldPolicyFileName;
66     private String serviceType;
67     private String uuid;
68     private String msLocation;
69     private String priority;
70     private String deleteCondition;
71     private String dictionaryType;
72     private String dictionary;
73     private String dictionaryFields;
74
75     /**
76
77      * Default constructor
78      */
79     private StdPAPPolicyParams() {
80         super();
81     }
82
83     public String getServiceType() {
84         return serviceType;
85     }
86
87     public String getOldPolicyFileName() {
88         return oldPolicyFileName;
89     }
90
91     public boolean isDraft() {
92         return draft;
93     }
94
95     public int getHighestVersion() {
96         return highestVersion;
97     }
98
99     public static StdPAPPolicyParamsBuilder builder() {
100         return new StdPAPPolicyParamsBuilder();
101     }
102
103     public String getConfigPolicyType() {
104         return configPolicyType;
105     }
106
107     public String getPolicyName() {
108         return policyName;
109     }
110
111     public String getDescription() {
112         return description;
113     }
114
115     public String getOnapName() {
116         return onapName;
117     }
118
119     public String getConfigName() {
120         return configName;
121     }
122
123     public Map<String, String> getDynamicFieldConfigAttributes() {
124         return dynamicFieldConfigAttributes;
125     }
126
127     public String getConfigType() {
128         return configType;
129     }
130
131     public String getConfigBodyData() {
132         return configBodyData;
133     }
134
135     public Boolean getEditPolicy() {
136         return editPolicy;
137     }
138
139     public String getDomain() {
140         return domain;
141     }
142
143     public String getRiskLevel() {
144         return riskLevel;
145     }
146
147     public String getRiskType() {
148         return riskType;
149     }
150
151     public String getGuard() {
152         return guard;
153     }
154
155     public String getTtlDate() {
156         return ttlDate;
157     }
158
159     public List<String> getDynamicRuleAlgorithmLabels() {
160         return dynamicRuleAlgorithmLabels;
161     }
162
163     public List<String> getDynamicRuleAlgorithmCombo() {
164         return dynamicRuleAlgorithmCombo;
165     }
166
167     public List<String> getDynamicRuleAlgorithmField1() {
168         return dynamicRuleAlgorithmField1;
169     }
170
171     public List<String> getDynamicRuleAlgorithmField2() {
172         return dynamicRuleAlgorithmField2;
173     }
174
175     public String getActionPerformer() {
176         return actionPerformer;
177     }
178
179     public String getActionAttribute() {
180         return actionAttribute;
181     }
182
183     public String getProviderComboBox() {
184         return providerComboBox;
185     }
186
187     public Map<String,String> getDynamicSettingsMap() {
188         return dynamicSettingsMap;
189     }
190
191     public List<Object> getDynamicVariableList() {
192         return dynamicVariableList;
193     }
194
195     public List<String> getDataTypeList() {
196         return dataTypeList;
197     }
198
199     public Map<String,String> getDropDownMap() {
200         return dropDownMap;
201     }
202
203     public Map<String,String> getTreatments() {
204         return treatments;
205     }
206
207     public String getPolicyID() {
208         return policyID;
209     }
210
211     public String getRuleID() {
212         return ruleID;
213     }
214
215     public String getVersion() {
216         return version;
217     }
218
219     public String getJsonBody() {
220         return jsonBody;
221     }
222
223     public String getBrmsController() {
224         return brmsController;
225     }
226
227     public List<String> getBrmsDependency() {
228         return brmsDependency;
229     }
230
231     public Map<String,String> getDrlRuleAndUIParams() {
232         return drlRuleAndUIParams;
233     }
234
235     public String getUuid() {
236         return uuid;
237     }
238
239     public void setUuid(String uuid) {
240         this.uuid = uuid;
241     }
242
243     public String getMsLocation() {
244         return msLocation;
245     }
246
247     public void setMsLocation(String msLocation) {
248         this.msLocation = msLocation;
249     }
250
251     public String getPriority() {
252         return priority;
253     }
254
255     public void setPriority(String priority) {
256         this.priority = priority;
257     }
258
259     public String getDeleteCondition() {
260         return deleteCondition;
261     }
262
263     public void setDeleteCondition(String deleteCondition) {
264         this.deleteCondition = deleteCondition;
265     }
266
267     public String getDictionaryType() {
268         return dictionaryType;
269     }
270
271     public void setDictionaryType(String dictionaryType) {
272         this.dictionaryType = dictionaryType;
273     }
274
275     public String getDictionary() {
276         return dictionary;
277     }
278
279     public void setDictionary(String dictionary) {
280         this.dictionary = dictionary;
281     }
282
283     public String getDictionaryFields() {
284         return dictionaryFields;
285     }
286
287     public void setDictionaryFields(String dictionaryFields) {
288         this.dictionaryFields = dictionaryFields;
289     }
290
291     /**
292      * Builder class for the Policy parameters
293      */
294     public static class StdPAPPolicyParamsBuilder {
295         StdPAPPolicyParams m = new StdPAPPolicyParams();
296
297         public StdPAPPolicyParams build() {
298             return m;
299         }
300
301         public StdPAPPolicyParamsBuilder configPolicyType(String configPolicyType) {
302             m.configPolicyType = configPolicyType;
303             return this;
304         }
305
306
307         public StdPAPPolicyParamsBuilder policyName(String policyName) {
308             m.policyName = policyName;
309             return this;
310         }
311
312         public StdPAPPolicyParamsBuilder description(String description) {
313             m.description = description;
314             return this;
315         }
316
317         public StdPAPPolicyParamsBuilder onapName(String onapName) {
318             m.onapName = onapName;
319             return this;
320         }
321
322         public StdPAPPolicyParamsBuilder configName(String configName) {
323             m.configName = configName;
324             return this;
325         }
326
327         public StdPAPPolicyParamsBuilder dynamicFieldConfigAttributes(Map<String, String> attributes) {
328             m.dynamicFieldConfigAttributes = attributes;
329             return this;
330         }
331
332         public StdPAPPolicyParamsBuilder configType(String configType) {
333             m.configType = configType;
334             return this;
335         }
336
337         public StdPAPPolicyParamsBuilder configBodyData(String body) {
338             m.configBodyData = body;
339             return this;
340         }
341
342         public StdPAPPolicyParamsBuilder editPolicy(boolean editPolicy) {
343             m.editPolicy = editPolicy;
344             return this;
345         }
346
347         public StdPAPPolicyParamsBuilder domain(String domain) {
348             m.domain = domain;
349             return this;
350         }
351
352         public StdPAPPolicyParamsBuilder riskLevel(String riskLevel) {
353             m.riskLevel = riskLevel;
354             return this;
355         }
356
357         public StdPAPPolicyParamsBuilder riskType(String riskType) {
358             m.riskType = riskType;
359             return this;
360         }
361
362         public StdPAPPolicyParamsBuilder guard(String guard) {
363             m.guard = guard;
364             return this;
365         }
366
367         public StdPAPPolicyParamsBuilder ttlDate(String ttlDate) {
368             m.ttlDate = ttlDate;
369             return this;
370         }
371
372         public StdPAPPolicyParamsBuilder highestVersion(int highVer) {
373             m.highestVersion = highVer;
374             return this;
375         }
376
377         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmLabels(List<String> dynamicRuleAlgorithmLabels) {
378             m.dynamicRuleAlgorithmLabels = dynamicRuleAlgorithmLabels;
379             return this;
380         }
381
382         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmCombo(List<String> dynamicRuleAlgorithmCombo) {
383             m.dynamicRuleAlgorithmCombo = dynamicRuleAlgorithmCombo;
384             return this;
385         }
386
387         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmField1(List<String> dynamicRuleAlgorithmField1) {
388             m.dynamicRuleAlgorithmField1 = dynamicRuleAlgorithmField1;
389             return this;
390         }
391
392         public StdPAPPolicyParamsBuilder dynamicRuleAlgorithmField2(List<String> dynamicRuleAlgorithmField2) {
393             m.dynamicRuleAlgorithmField2 = dynamicRuleAlgorithmField2;
394             return this;
395         }
396
397         public StdPAPPolicyParamsBuilder actionPerformer(String actionPerformer) {
398             m.actionPerformer = actionPerformer;
399             return this;
400         }
401
402         public StdPAPPolicyParamsBuilder actionAttribute(String actionAttribute) {
403             m.actionAttribute = actionAttribute;
404             return this;
405         }
406
407         public StdPAPPolicyParamsBuilder providerComboBox(String providerComboBox) {
408             m.providerComboBox = providerComboBox;
409             return this;
410         }
411
412         public StdPAPPolicyParamsBuilder dynamicVariableList(List<Object> dynamicVariableList) {
413             m.dynamicVariableList = dynamicVariableList;
414             return this;
415         }
416
417         public StdPAPPolicyParamsBuilder dynamicSettingsMap(Map<String, String> dynamicSettingsMap) {
418             m.dynamicSettingsMap = dynamicSettingsMap;
419             return this;
420         }
421
422         public StdPAPPolicyParamsBuilder dataTypeList(List<String> dataTypeList) {
423             m.dataTypeList = dataTypeList;
424             return this;
425         }
426
427         public StdPAPPolicyParamsBuilder dropDownMap(Map<String, String> dropDownMap){
428             m.dropDownMap = dropDownMap;
429             return this;
430         }
431
432         public StdPAPPolicyParamsBuilder treatments(Map<String,String> treatments) {
433             m.treatments = treatments;
434             return this;
435         }
436
437         public StdPAPPolicyParamsBuilder policyID(String policyID) {
438             m.policyID = policyID;
439             return this;
440         }
441
442         public StdPAPPolicyParamsBuilder ruleID(String ruleID) {
443             m.ruleID = ruleID;
444             return this;
445         }
446
447         public StdPAPPolicyParamsBuilder version(String version) {
448             m.version = version;
449             return this;
450         }
451
452         public StdPAPPolicyParamsBuilder jsonBody(String jsonBody) {
453             m.jsonBody = jsonBody;
454             return this;
455         }
456
457         public StdPAPPolicyParamsBuilder brmsController(String controllerName) {
458             m.brmsController = controllerName;
459             return this;
460         }
461
462         public StdPAPPolicyParamsBuilder brmsDependency(List<String> dependencyNames) {
463             m.brmsDependency = dependencyNames;
464             return this;
465         }
466
467         public StdPAPPolicyParamsBuilder drlRuleAndUIParams(Map<String,String> drlRuleAndUIParams) {
468             m.drlRuleAndUIParams = drlRuleAndUIParams;
469             return this;
470         }
471
472         public StdPAPPolicyParamsBuilder draft(boolean b) {
473             m.draft = b;
474             return this;
475         }
476
477         public StdPAPPolicyParamsBuilder oldPolicyFileName(String name) {
478             m.oldPolicyFileName = name;
479             return this;
480         }
481
482         public StdPAPPolicyParamsBuilder serviceType(String s) {
483             m.serviceType = s;
484             return this;
485         }
486
487         public StdPAPPolicyParamsBuilder uuid(String uuid) {
488             m.uuid = uuid;
489             return this;
490         }
491
492         public StdPAPPolicyParamsBuilder msLocation(String msLocation) {
493             m.msLocation = msLocation;
494             return this;
495         }
496
497         public StdPAPPolicyParamsBuilder priority(String priority) {
498             m.priority = priority;
499             return this;
500         }
501
502         public StdPAPPolicyParamsBuilder deleteCondition(String deleteCondition) {
503             m.deleteCondition = deleteCondition;
504             return this;
505         }
506
507         public StdPAPPolicyParamsBuilder dictionaryType(String dictionaryType) {
508             m.dictionaryType = dictionaryType;
509             return this;
510         }
511
512         public StdPAPPolicyParamsBuilder dictionary(String dictionary) {
513             m.dictionary = dictionary;
514             return this;
515         }
516
517         public StdPAPPolicyParamsBuilder dictionaryFields(String dictionaryFields) {
518             m.dictionaryFields = dictionaryFields;
519             return this;
520         }
521     }
522 }