From ec7da6aea30a1b73d1e0f5f75d2b6119ed8fa251 Mon Sep 17 00:00:00 2001 From: "Ben David, Elad (eb7504)" Date: Tue, 17 Mar 2020 18:12:17 +0200 Subject: Entitlement Pool - Support Type Field Change-Id: Ibd9996cce04849332bd23dd62e6143386cdd9a70 Issue-ID: SDC-2820 Signed-off-by: Ben David, Elad (eb7504) --- .../dao/types/EntitlementPoolEntity.java | 13 +++++++- .../dao/types/EntitlementPoolType.java | 35 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java index 4c2435a3a5..4d3c1d63a7 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java @@ -57,6 +57,7 @@ public class EntitlementPoolEntity implements VersionableEntity { private String id; private String name; private String description; + private EntitlementPoolType type; @Column(name = "threshold") private Integer thresholdValue; @@ -179,6 +180,14 @@ public class EntitlementPoolEntity implements VersionableEntity { this.description = description; } + public EntitlementPoolType getType() { + return type; + } + + public void setType(EntitlementPoolType type) { + this.type = type; + } + public Integer getThresholdValue() { return thresholdValue; } @@ -311,7 +320,7 @@ public class EntitlementPoolEntity implements VersionableEntity { @Override public int hashCode() { return Objects - .hash(vendorLicenseModelId, version, id, name, description, thresholdValue, thresholdUnit, + .hash(vendorLicenseModelId, version, id, name, description, type, thresholdValue, thresholdUnit, increments, operationalScope, referencingFeatureGroups, startDate, expiryDate); } @@ -329,6 +338,7 @@ public class EntitlementPoolEntity implements VersionableEntity { && Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(description, that.description) + && type == that.type && Objects.equals(thresholdUnit, that.thresholdUnit) && Objects.equals(increments, that.increments) && Objects.equals(that.operationalScope, operationalScope) @@ -346,6 +356,7 @@ public class EntitlementPoolEntity implements VersionableEntity { + ", id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + + ", type=" + type + ", thresholdValue=" + thresholdValue + ", thresholdUnit='" + thresholdUnit + '\'' + ", increments='" + increments + '\'' diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java new file mode 100644 index 0000000000..3b66fab110 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.vendorlicense.dao.types; + +public enum EntitlementPoolType { + Universal, + Unique, + One_Time; + + public static EntitlementPoolType permissiveValueOf(String name) { + if (name == null){ + return null; + } else { + return EntitlementPoolType.valueOf(name); + } + } +} -- cgit 1.2.3-korg