Merge "Adding Junit"
[so.git] / bpmn / MSOCoreBPMN / src / main / java / org / openecomp / mso / bpmn / core / domain / License.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.bpmn.core.domain;\r
22 \r
23 import java.io.Serializable;\r
24 import java.util.ArrayList;\r
25 import java.util.Arrays;\r
26 import java.util.List;\r
27 \r
28 import org.json.JSONArray;\r
29 \r
30 import com.fasterxml.jackson.annotation.JsonIgnore;\r
31 import com.fasterxml.jackson.annotation.JsonInclude;\r
32 import com.fasterxml.jackson.annotation.JsonRootName;\r
33 \r
34 /**\r
35  * Stores licensing information and is an attribute\r
36  * of a <class>HomingSolution</class>\r
37  *\r
38  */\r
39 @JsonRootName("license")\r
40 @JsonInclude(JsonInclude.Include.NON_EMPTY)\r
41 public class License extends JsonWrapper implements Serializable  {\r
42 \r
43         private static final long serialVersionUID = 1L;\r
44 \r
45         StringBuilder sb = new StringBuilder();\r
46 \r
47         @JsonInclude(JsonInclude.Include.NON_EMPTY)\r
48         private List<String> entitlementPoolList = new ArrayList<String>();\r
49         @JsonInclude(JsonInclude.Include.NON_EMPTY)\r
50         private List<String> licenseKeyGroupList = new ArrayList<String>();\r
51 \r
52 \r
53         public List<String> getEntitlementPoolList() {\r
54                 return entitlementPoolList;\r
55         }\r
56 \r
57         public void setEntitlementPoolList(List<String> entitlementPoolList) {\r
58                 this.entitlementPoolList = entitlementPoolList;\r
59         }\r
60 \r
61         public List<String> getLicenseKeyGroupList() {\r
62                 return licenseKeyGroupList;\r
63         }\r
64 \r
65         public void setLicenseKeyGroupList(List<String> licenseKeyGroupList) {\r
66                 this.licenseKeyGroupList = licenseKeyGroupList;\r
67         }\r
68 \r
69         /**\r
70          * This method adds a Entitlement Pool Uuid\r
71          * to the EntitlementPoolList\r
72          *\r
73          * @param the EntitlementPoolUuid\r
74          */\r
75         public void addEntitlementPool(String entitlementPoolUuid) {\r
76                 entitlementPoolList.add(entitlementPoolUuid);\r
77         }\r
78 \r
79         /**\r
80          * This method adds a License Key Group Uuid\r
81          * to the LicenseKeyGroupList\r
82          *\r
83          * @param the licenseKeyGroupUuid\r
84          */\r
85         public void addLicenseKeyGroup(String licenseKeyGroupUuid) {\r
86                 licenseKeyGroupList.add(licenseKeyGroupUuid);\r
87         }\r
88 \r
89         /**\r
90          * This method returns the licenseKeyGroupList\r
91          * as a json array\r
92          *\r
93          * @return the strList\r
94          */\r
95         @JsonIgnore\r
96         public JSONArray getLicenseKeyGroupListAsString() {\r
97         JSONArray array = new JSONArray(licenseKeyGroupList);\r
98                 return array;\r
99         }\r
100 \r
101         /**\r
102          * This method returns the entitlementPoolList\r
103          * as a json array\r
104          *\r
105          * @return the strList\r
106          */\r
107         @JsonIgnore\r
108         public JSONArray getEntitlementPoolListAsString() {\r
109         JSONArray array = new JSONArray(entitlementPoolList);\r
110                 return array;\r
111         }\r
112 \r
113         /**\r
114          * @return the serialversionuid\r
115          */\r
116         public static long getSerialversionuid() {\r
117                 return serialVersionUID;\r
118         }\r
119 \r
120 }\r