2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.bpmn.core.domain;
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;
33 * Stores licensing information and is an attribute of a <class>HomingSolution</class>
36 @JsonRootName("license")
37 @JsonInclude(JsonInclude.Include.NON_EMPTY)
38 public class License extends JsonWrapper implements Serializable {
40 private static final long serialVersionUID = 1L;
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>();
48 public List<String> getEntitlementPoolList() {
49 return entitlementPoolList;
52 public void setEntitlementPoolList(List<String> entitlementPoolList) {
53 this.entitlementPoolList = entitlementPoolList;
56 public List<String> getLicenseKeyGroupList() {
57 return licenseKeyGroupList;
60 public void setLicenseKeyGroupList(List<String> licenseKeyGroupList) {
61 this.licenseKeyGroupList = licenseKeyGroupList;
65 * This method adds a Entitlement Pool Uuid to the EntitlementPoolList
67 * @param the EntitlementPoolUuid
69 public void addEntitlementPool(String entitlementPoolUuid) {
70 entitlementPoolList.add(entitlementPoolUuid);
74 * This method adds a License Key Group Uuid to the LicenseKeyGroupList
76 * @param the licenseKeyGroupUuid
78 public void addLicenseKeyGroup(String licenseKeyGroupUuid) {
79 licenseKeyGroupList.add(licenseKeyGroupUuid);
83 * This method returns the licenseKeyGroupList as a json array
88 public JSONArray getLicenseKeyGroupListAsString() {
89 JSONArray array = new JSONArray(licenseKeyGroupList);
94 * This method returns the entitlementPoolList as a json array
99 public JSONArray getEntitlementPoolListAsString() {
100 JSONArray array = new JSONArray(entitlementPoolList);
105 * @return the serialversionuid
107 public static long getSerialversionuid() {
108 return serialVersionUID;