Unit/SONAR/Checkstyle in ONAP-REST
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / util / MsAttributeObject.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP-REST
4  * ================================================================================
5  * Copyright (C) 2017,2019 AT&T Intellectual Property. All rights reserved.
6  * Modifications Copyright (C) 2019 Nordix Foundation.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.rest.util;
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27 import lombok.Getter;
28 import lombok.Setter;
29
30 @Getter
31 @Setter
32 public class MsAttributeObject {
33
34     private String className;
35     private Map<String, String> attribute = new HashMap<>();
36     private Map<String, String> refAttribute = new HashMap<>();
37     private Map<String, Object> subClass = new HashMap<>();
38     private String dependency;
39     private Map<String, String> enumType = new HashMap<>();
40     private Map<String, String> matchingSet = new HashMap<>();
41     private boolean policyTempalate;
42     private String ruleFormation;
43     private String dataOrderInfo;
44
45     public void addAttribute(String key, String value) {
46         this.attribute.put(key, value);
47     }
48
49     public void addRefAttribute(String key, String value) {
50         this.refAttribute.put(key, value);
51     }
52
53     public void addAllAttribute(Map<String, String> map) {
54         this.attribute.putAll(map);
55     }
56
57     public void addAllRefAttribute(Map<String, String> map) {
58         this.refAttribute.putAll(map);
59     }
60
61     public void addAllSubClass(Map<String, Object> subClass) {
62         this.subClass.putAll(subClass);
63     }
64
65     public void addSingleEnum(String key, String value) {
66         this.enumType.put(key, value);
67     }
68
69     public void addMatchingSet(String key, String value) {
70         this.matchingSet.put(key, value);
71     }
72
73     public void addMatchingSet(Map<String, String> matchingSet) {
74         this.matchingSet.putAll(matchingSet);
75     }
76 }