Merge "Add copy constructors to more models-pdp classes"
[policy/models.git] / models-tosca / src / main / java / org / onap / policy / models / tosca / simple / concepts / JpaToscaDataTypes.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.Map;
24 import java.util.TreeMap;
25
26 import javax.persistence.Entity;
27 import javax.persistence.Inheritance;
28 import javax.persistence.InheritanceType;
29 import javax.persistence.Table;
30
31 import lombok.Data;
32 import lombok.EqualsAndHashCode;
33
34 import org.onap.policy.models.base.PfConceptContainer;
35 import org.onap.policy.models.base.PfConceptKey;
36
37 /**
38  * This class is a container for TOSCA data types.
39  *
40  * @author Liam Fallon (liam.fallon@est.tech)
41  */
42 @Entity
43 @Table(name = "ToscaDataTypes")
44 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
45 @Data
46 @EqualsAndHashCode(callSuper = true)
47 public class JpaToscaDataTypes extends PfConceptContainer<JpaToscaDataType> {
48     private static final long serialVersionUID = 2941102271022190348L;
49
50     public static final String DEFAULT_NAME = "ToscaDataTypesSimple";
51     public static final String DEFAULT_VERSION = "1.0.0";
52
53     /**
54      * The Default Constructor creates a {@link JpaToscaDataTypes} object with a null artifact key
55      * and creates an empty concept map.
56      */
57     public JpaToscaDataTypes() {
58         super(new PfConceptKey(DEFAULT_NAME, DEFAULT_VERSION));
59     }
60
61     /**
62      * The Key Constructor creates a {@link JpaToscaDataTypes} object with the given artifact key
63      * and creates an empty concept map.
64      *
65      * @param key the concept key
66      */
67     public JpaToscaDataTypes(final PfConceptKey key) {
68         super(key, new TreeMap<PfConceptKey, JpaToscaDataType>());
69     }
70
71     /**
72      * This Constructor creates an concept container with all of its fields defined.
73      *
74      * @param key the concept container key
75      * @param conceptMap the concepts to be stored in the concept container
76      */
77     public JpaToscaDataTypes(final PfConceptKey key, final Map<PfConceptKey, JpaToscaDataType> conceptMap) {
78         super(key, conceptMap);
79     }
80
81     /**
82      * Copy constructor.
83      *
84      * @param copyConcept the concept to copy from
85      */
86     public JpaToscaDataTypes(final JpaToscaDataTypes copyConcept) {
87         super(copyConcept);
88     }
89 }