Java 17 Upgrade
[policy/models.git] / models-tosca / src / main / java / org / onap / policy / models / tosca / simple / concepts / JpaToscaServiceTemplates.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019, 2023 Nordix Foundation.
4  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.models.tosca.simple.concepts;
23
24 import jakarta.persistence.Entity;
25 import jakarta.persistence.Inheritance;
26 import jakarta.persistence.InheritanceType;
27 import jakarta.persistence.Table;
28 import java.util.List;
29 import java.util.Map;
30 import java.util.TreeMap;
31 import lombok.Data;
32 import lombok.EqualsAndHashCode;
33 import org.onap.policy.models.base.PfConceptContainer;
34 import org.onap.policy.models.base.PfConceptKey;
35 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
36
37 /**
38  * This class is a container for TOSCA service templates.
39  *
40  * @author Liam Fallon (liam.fallon@est.tech)
41  */
42 @Entity
43 @Table(name = "ToscaServiceTemplates")
44 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
45 @Data
46 @EqualsAndHashCode(callSuper = true)
47 public class JpaToscaServiceTemplates extends PfConceptContainer<JpaToscaServiceTemplate, ToscaServiceTemplate> {
48     private static final long serialVersionUID = -3053257884307604114L;
49
50     /**
51      * The Default Constructor creates a {@link JpaToscaServiceTemplates} object with a null artifact key and creates an
52      * empty concept map.
53      */
54     public JpaToscaServiceTemplates() {
55         super(new PfConceptKey());
56     }
57
58     /**
59      * The Key Constructor creates a {@link JpaToscaServiceTemplates} object with the given artifact key and creates an
60      * empty concept map.
61      *
62      * @param key the concept key
63      */
64     public JpaToscaServiceTemplates(final PfConceptKey key) {
65         super(key, new TreeMap<>());
66     }
67
68     /**
69      * This Constructor creates an concept container with all of its fields defined.
70      *
71      * @param key the concept container key
72      * @param conceptMap the concepts to be stored in the concept container
73      */
74     public JpaToscaServiceTemplates(final PfConceptKey key,
75             final Map<PfConceptKey, JpaToscaServiceTemplate> conceptMap) {
76         super(key, conceptMap);
77     }
78
79     /**
80      * Copy constructor.
81      *
82      * @param copyConcept the concept to copy from
83      */
84     public JpaToscaServiceTemplates(final JpaToscaServiceTemplates copyConcept) {
85         super(copyConcept);
86     }
87
88     /**
89      * Authorative constructor.
90      *
91      * @param authorativeConceptMapList the authorative concept to copy from
92      */
93     public JpaToscaServiceTemplates(final List<Map<String, ToscaServiceTemplate>> authorativeConceptMapList) {
94         this.fromAuthorative(authorativeConceptMapList);
95     }
96 }