aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main
diff options
context:
space:
mode:
authorBen David, Elad (eb7504) <eb7504@intl.att.com>2020-03-17 18:12:17 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-03-23 08:06:19 +0000
commitec7da6aea30a1b73d1e0f5f75d2b6119ed8fa251 (patch)
treede325ed98badf0aa456b52d3f10257dec26a8228 /openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main
parent1a64c83fc436e17f93e468f7d46ff9f5fcb081ce (diff)
Entitlement Pool - Support Type Field
Change-Id: Ibd9996cce04849332bd23dd62e6143386cdd9a70 Issue-ID: SDC-2820 Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java13
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java35
2 files changed, 47 insertions, 1 deletions
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);
+ }
+ }
+}