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;
28 import org.json.JSONArray;
30 import com.fasterxml.jackson.annotation.JsonIgnore;
31 import com.fasterxml.jackson.annotation.JsonInclude;
32 import com.fasterxml.jackson.annotation.JsonRootName;
35 * Stores licensing information and is an attribute
36 * of a <class>HomingSolution</class>
39 @JsonRootName("license")
40 @JsonInclude(JsonInclude.Include.NON_EMPTY)
41 public class License extends JsonWrapper implements Serializable {
43 private static final long serialVersionUID = 1L;
45 @JsonInclude(JsonInclude.Include.NON_EMPTY)
46 private List<String> entitlementPoolList = new ArrayList<String>();
47 @JsonInclude(JsonInclude.Include.NON_EMPTY)
48 private List<String> licenseKeyGroupList = new ArrayList<String>();
51 public List<String> getEntitlementPoolList() {
52 return entitlementPoolList;
55 public void setEntitlementPoolList(List<String> entitlementPoolList) {
56 this.entitlementPoolList = entitlementPoolList;
59 public List<String> getLicenseKeyGroupList() {
60 return licenseKeyGroupList;
63 public void setLicenseKeyGroupList(List<String> licenseKeyGroupList) {
64 this.licenseKeyGroupList = licenseKeyGroupList;
68 * This method adds a Entitlement Pool Uuid
69 * to the EntitlementPoolList
71 * @param the EntitlementPoolUuid
73 public void addEntitlementPool(String entitlementPoolUuid) {
74 entitlementPoolList.add(entitlementPoolUuid);
78 * This method adds a License Key Group Uuid
79 * to the LicenseKeyGroupList
81 * @param the licenseKeyGroupUuid
83 public void addLicenseKeyGroup(String licenseKeyGroupUuid) {
84 licenseKeyGroupList.add(licenseKeyGroupUuid);
88 * This method returns the licenseKeyGroupList
94 public JSONArray getLicenseKeyGroupListAsString() {
95 JSONArray array = new JSONArray(licenseKeyGroupList);
100 * This method returns the entitlementPoolList
103 * @return the strList
106 public JSONArray getEntitlementPoolListAsString() {
107 JSONArray array = new JSONArray(entitlementPoolList);
112 * @return the serialversionuid
114 public static long getSerialversionuid() {
115 return serialVersionUID;