From fd809717ca774dfabeddd3984fbbbbdfd029601e Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 26 Aug 2019 12:20:27 -0400 Subject: Replace copyTo methods with copy constructors Deleted the copyTo() method from PfConcepts and replaced uses with deep-copy constructors. Also added mapMap() and makeCopy() methods to PfUtils to facilitate. Change-Id: Id6391bb806ef0dfab6c1089278bf2b514c7e303e Issue-ID: POLICY-1600 Signed-off-by: Jim Hahn --- .../tosca/simple/concepts/JpaToscaDataType.java | 38 ++--------------- .../tosca/simple/concepts/JpaToscaDataTypes.java | 4 +- .../tosca/simple/concepts/JpaToscaEntityType.java | 32 +++----------- .../tosca/simple/concepts/JpaToscaEventFilter.java | 22 ++-------- .../tosca/simple/concepts/JpaToscaModel.java | 17 +------- .../tosca/simple/concepts/JpaToscaPolicies.java | 4 +- .../tosca/simple/concepts/JpaToscaPolicy.java | 37 ++-------------- .../tosca/simple/concepts/JpaToscaPolicyType.java | 49 ++-------------------- .../tosca/simple/concepts/JpaToscaPolicyTypes.java | 4 +- .../tosca/simple/concepts/JpaToscaProperty.java | 40 ++++-------------- .../simple/concepts/JpaToscaServiceTemplate.java | 27 +++--------- .../simple/concepts/JpaToscaTimeInterval.java | 21 ++-------- .../simple/concepts/JpaToscaTopologyTemplate.java | 21 ++-------- .../tosca/simple/concepts/JpaToscaTrigger.java | 37 ++++++---------- 14 files changed, 63 insertions(+), 290 deletions(-) (limited to 'models-tosca/src/main') diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java index 7e2b641a2..e9590072e 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java @@ -28,18 +28,14 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; - import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Table; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.models.base.PfAuthorative; import org.onap.policy.models.base.PfConcept; import org.onap.policy.models.base.PfConceptKey; @@ -96,6 +92,9 @@ public class JpaToscaDataType extends JpaToscaEntityType implemen */ public JpaToscaDataType(final JpaToscaDataType copyConcept) { super(copyConcept); + // Constraints are immutable + this.constraints = (copyConcept.constraints != null ? new ArrayList<>(copyConcept.constraints) : null); + this.properties = PfUtils.mapMap(copyConcept.properties, JpaToscaProperty::new); } /** @@ -264,35 +263,4 @@ public class JpaToscaDataType extends JpaToscaEntityType implemen return 0; } - - @Override - public PfConcept copyTo(@NonNull PfConcept target) { - final Object copyObject = target; - Assertions.instanceOf(copyObject, PfConcept.class); - - final JpaToscaDataType copy = ((JpaToscaDataType) copyObject); - super.copyTo(target); - - if (constraints == null) { - copy.setConstraints(null); - } else { - final List newConstraints = new ArrayList<>(); - for (final JpaToscaConstraint constraint : constraints) { - newConstraints.add(constraint); // Constraints are immutable - } - copy.setConstraints(newConstraints); - } - - if (properties == null) { - copy.setProperties(null); - } else { - final Map newProperties = new LinkedHashMap<>(); - for (final Entry propertyEntry : properties.entrySet()) { - newProperties.put(propertyEntry.getKey(), new JpaToscaProperty(propertyEntry.getValue())); - } - copy.setProperties(newProperties); - } - - return copy; - } } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java index 67d4ecf4f..8908ba7bf 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 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. @@ -31,7 +32,7 @@ import javax.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; - +import lombok.ToString; import org.onap.policy.models.base.PfConceptContainer; import org.onap.policy.models.base.PfConceptKey; import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType; @@ -45,6 +46,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType; @Table(name = "ToscaDataTypes") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Data +@ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class JpaToscaDataTypes extends PfConceptContainer { private static final long serialVersionUID = 2941102271022190348L; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java index bade7a227..506add346 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 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. @@ -25,20 +26,16 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; - import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.ElementCollection; import javax.persistence.EmbeddedId; import javax.persistence.MappedSuperclass; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - import org.apache.commons.lang3.ObjectUtils; -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.common.utils.validation.ParameterValidationUtils; import org.onap.policy.models.base.PfAuthorative; import org.onap.policy.models.base.PfConcept; @@ -104,6 +101,10 @@ public class JpaToscaEntityType extends PfConcept impleme */ public JpaToscaEntityType(final JpaToscaEntityType copyConcept) { super(copyConcept); + this.key = new PfConceptKey(copyConcept.key); + this.derivedFrom = (copyConcept.derivedFrom != null ? new PfConceptKey(copyConcept.derivedFrom) : null); + this.metadata = (copyConcept.metadata != null ? new TreeMap<>(copyConcept.metadata) : null); + this.description = copyConcept.description; } /** @@ -269,27 +270,4 @@ public class JpaToscaEntityType extends PfConcept impleme return ObjectUtils.compare(description, other.description); } - - @Override - public PfConcept copyTo(@NonNull PfConcept target) { - final Object copyObject = target; - Assertions.instanceOf(copyObject, PfConcept.class); - - @SuppressWarnings("unchecked") - final JpaToscaEntityType copy = ((JpaToscaEntityType) copyObject); - copy.setKey(new PfConceptKey(key)); - copy.setDerivedFrom(derivedFrom != null ? new PfConceptKey(derivedFrom) : null); - - if (metadata != null) { - final Map newMatadata = new TreeMap<>(); - for (final Entry metadataEntry : metadata.entrySet()) { - newMatadata.put(metadataEntry.getKey(), metadataEntry.getValue()); - } - copy.setMetadata(newMatadata); - } - - copy.setDescription(description); - - return copy; - } } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java index 40727c9c0..716813799 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java @@ -24,20 +24,16 @@ package org.onap.policy.models.tosca.simple.concepts; import java.util.List; - import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Table; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - import org.apache.commons.lang3.ObjectUtils; -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.models.base.PfConcept; import org.onap.policy.models.base.PfConceptKey; import org.onap.policy.models.base.PfKey; @@ -105,6 +101,10 @@ public class JpaToscaEventFilter extends PfConcept { */ public JpaToscaEventFilter(final JpaToscaEventFilter copyConcept) { super(copyConcept); + this.key = new PfReferenceKey(copyConcept.key); + this.node = new PfConceptKey(copyConcept.node); + this.requirement = copyConcept.requirement; + this.capability = copyConcept.capability; } @Override @@ -180,18 +180,4 @@ public class JpaToscaEventFilter extends PfConcept { return ObjectUtils.compare(capability, other.capability); } - - @Override - public PfConcept copyTo(@NonNull final PfConcept target) { - final Object copyObject = target; - Assertions.instanceOf(copyObject, JpaToscaEventFilter.class); - - final JpaToscaEventFilter copy = ((JpaToscaEventFilter) copyObject); - copy.setKey(new PfReferenceKey(key)); - copy.setNode(new PfConceptKey(node)); - copy.setRequirement(requirement); - copy.setCapability(capability); - - return copy; - } } \ No newline at end of file diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java index 5e4bd4f5c..cc9b1bc96 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 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. @@ -21,7 +22,6 @@ package org.onap.policy.models.tosca.simple.concepts; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -29,12 +29,9 @@ import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.OneToOne; import javax.persistence.Table; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.models.base.PfConcept; import org.onap.policy.models.base.PfConceptKey; import org.onap.policy.models.base.PfKey; @@ -97,6 +94,7 @@ public class JpaToscaModel extends PfModel { */ public JpaToscaModel(@NonNull final JpaToscaModel copyConcept) { super(copyConcept); + this.serviceTemplates = new JpaToscaServiceTemplates(copyConcept.serviceTemplates); } @Override @@ -147,15 +145,4 @@ public class JpaToscaModel extends PfModel { return serviceTemplates.compareTo(other.serviceTemplates); } - - @Override - public PfConcept copyTo(@NonNull final PfConcept targetObject) { - Assertions.instanceOf(targetObject, JpaToscaModel.class); - - final JpaToscaModel copy = ((JpaToscaModel) targetObject); - super.copyTo(targetObject); - copy.setServiceTemplates(new JpaToscaServiceTemplates(serviceTemplates)); - - return copy; - } } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java index 012d8a26f..25e7dc071 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 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. @@ -31,7 +32,7 @@ import javax.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; - +import lombok.ToString; import org.onap.policy.models.base.PfAuthorative; import org.onap.policy.models.base.PfConceptContainer; import org.onap.policy.models.base.PfConceptKey; @@ -46,6 +47,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; @Table(name = "ToscaPolicies") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Data +@ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class JpaToscaPolicies extends PfConceptContainer implements PfAuthorative>> { diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java index 7b4ffd164..36acec018 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java @@ -23,12 +23,10 @@ package org.onap.policy.models.tosca.simple.concepts; -import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; - import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; @@ -39,14 +37,11 @@ import javax.persistence.InheritanceType; import javax.persistence.Lob; import javax.persistence.Table; import javax.ws.rs.core.Response; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.common.utils.validation.ParameterValidationUtils; import org.onap.policy.models.base.PfAuthorative; import org.onap.policy.models.base.PfConcept; @@ -129,6 +124,9 @@ public class JpaToscaPolicy extends JpaToscaEntityType implements P */ public JpaToscaPolicy(@NonNull final JpaToscaPolicy copyConcept) { super(copyConcept); + this.type = new PfConceptKey(copyConcept.type); + this.properties = (copyConcept.properties != null ? new LinkedHashMap<>(copyConcept.properties) : null); + this.targets = PfUtils.mapList(copyConcept.targets, PfConceptKey::new); } /** @@ -350,33 +348,4 @@ public class JpaToscaPolicy extends JpaToscaEntityType implements P return PfUtils.compareObjects(targets, other.targets); } - - @Override - public PfConcept copyTo(@NonNull PfConcept target) { - final Object copyObject = target; - Assertions.instanceOf(copyObject, PfConcept.class); - - final JpaToscaPolicy copy = ((JpaToscaPolicy) copyObject); - super.copyTo(target); - - copy.setType(new PfConceptKey(type)); - - if (properties == null) { - copy.setProperties(null); - } else { - copy.setProperties(properties); - } - - if (targets == null) { - copy.setTargets(null); - } else { - final List newTargets = new ArrayList<>(); - for (final PfConceptKey oldTarget : targets) { - newTargets.add(new PfConceptKey(oldTarget)); - } - copy.setTargets(newTargets); - } - - return copy; - } } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java index d7560c46e..37e92b58a 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java @@ -23,24 +23,19 @@ package org.onap.policy.models.tosca.simple.concepts; -import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; - import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Lob; import javax.persistence.Table; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.models.base.PfAuthorative; import org.onap.policy.models.base.PfConcept; import org.onap.policy.models.base.PfConceptKey; @@ -101,6 +96,9 @@ public class JpaToscaPolicyType extends JpaToscaEntityType impl */ public JpaToscaPolicyType(final JpaToscaPolicyType copyConcept) { super(copyConcept); + this.properties = PfUtils.mapMap(copyConcept.properties, JpaToscaProperty::new); + this.targets = PfUtils.mapList(copyConcept.targets, PfConceptKey::new); + this.triggers = PfUtils.mapList(copyConcept.triggers, JpaToscaTrigger::new); } /** @@ -300,45 +298,4 @@ public class JpaToscaPolicyType extends JpaToscaEntityType impl return PfUtils.compareObjects(triggers, other.triggers); } - - @Override - public PfConcept copyTo(@NonNull PfConcept target) { - final Object copyObject = target; - Assertions.instanceOf(copyObject, PfConcept.class); - - final JpaToscaPolicyType copy = ((JpaToscaPolicyType) copyObject); - super.copyTo(target); - - if (properties == null) { - copy.setProperties(null); - } else { - final Map newProperties = new LinkedHashMap<>(); - for (final Entry propertyEntry : properties.entrySet()) { - newProperties.put(propertyEntry.getKey(), new JpaToscaProperty(propertyEntry.getValue())); - } - copy.setProperties(newProperties); - } - - if (targets == null) { - copy.setTargets(null); - } else { - final List newTargets = new ArrayList<>(); - for (final PfConceptKey oldTarget : targets) { - newTargets.add(new PfConceptKey(oldTarget)); - } - copy.setTargets(newTargets); - } - - if (triggers == null) { - copy.setTargets(null); - } else { - final List newTriggers = new ArrayList<>(); - for (final JpaToscaTrigger trigger : triggers) { - newTriggers.add(new JpaToscaTrigger(trigger)); - } - copy.setTriggers(newTriggers); - } - - return copy; - } } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java index af8a21a60..5a54a33a7 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 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. @@ -31,7 +32,7 @@ import javax.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; - +import lombok.ToString; import org.onap.policy.models.base.PfConceptContainer; import org.onap.policy.models.base.PfConceptKey; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType; @@ -45,6 +46,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType; @Table(name = "ToscaPolicyTypes") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Data +@ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class JpaToscaPolicyTypes extends PfConceptContainer { private static final long serialVersionUID = -4157979965271220098L; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java index 10e8b5d04..93da035a5 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java @@ -25,7 +25,6 @@ package org.onap.policy.models.tosca.simple.concepts; import java.util.ArrayList; import java.util.List; - import javax.persistence.Column; import javax.persistence.ElementCollection; import javax.persistence.EmbeddedId; @@ -33,13 +32,10 @@ import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Table; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - import org.apache.commons.lang3.ObjectUtils; -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.models.base.PfAuthorative; import org.onap.policy.models.base.PfConcept; import org.onap.policy.models.base.PfConceptKey; @@ -125,6 +121,15 @@ public class JpaToscaProperty extends PfConcept implements PfAuthorative(copyConcept.constraints) : null); + this.entrySchema = (copyConcept.entrySchema != null ? new JpaToscaEntrySchema(copyConcept.entrySchema) : null); } /** @@ -334,31 +339,4 @@ public class JpaToscaProperty extends PfConcept implements PfAuthorative newConstraints = new ArrayList<>(); - for (final JpaToscaConstraint constraint : constraints) { - newConstraints.add(constraint); // Constraints are immutable - } - copy.setConstraints(newConstraints); - } - - copy.setEntrySchema(entrySchema != null ? new JpaToscaEntrySchema(entrySchema) : null); - - return copy; - } } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java index 904db849c..83c9dc0cf 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 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. @@ -21,9 +22,7 @@ package org.onap.policy.models.tosca.simple.concepts; import com.google.gson.annotations.SerializedName; - import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -32,13 +31,10 @@ import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.OneToOne; import javax.persistence.Table; - import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; - import org.apache.commons.lang3.ObjectUtils; -import org.onap.policy.common.utils.validation.Assertions; import org.onap.policy.common.utils.validation.ParameterValidationUtils; import org.onap.policy.models.base.PfAuthorative; import org.onap.policy.models.base.PfConcept; @@ -119,6 +115,11 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType