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