/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Lob;
+import jakarta.persistence.MappedSuperclass;
+import java.io.Serial;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import javax.persistence.ElementCollection;
-import javax.persistence.Lob;
-import javax.persistence.MappedSuperclass;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@EqualsAndHashCode(callSuper = true)
public abstract class JpaToscaWithToscaProperties<T extends ToscaWithToscaProperties> extends JpaToscaEntityType<T>
implements PfAuthorative<T> {
+ @Serial
private static final long serialVersionUID = -563659852901842616L;
@ElementCollection
if (authorativeConcept.getProperties() != null) {
properties = new LinkedHashMap<>();
for (Entry<String, ToscaProperty> toscaPropertyEntry : authorativeConcept.getProperties().entrySet()) {
- JpaToscaProperty jpaProperty = new JpaToscaProperty(toscaPropertyEntry.getValue());
+ var jpaProperty = new JpaToscaProperty(toscaPropertyEntry.getValue());
jpaProperty.setKey(new PfReferenceKey(getKey(), toscaPropertyEntry.getKey()));
properties.put(toscaPropertyEntry.getKey(), jpaProperty);
}
@Override
public T toAuthorative() {
- T tosca = super.toAuthorative();
+ var tosca = super.toAuthorative();
tosca.setProperties(PfUtils.mapMap(properties, JpaToscaProperty::toAuthorative));