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