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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.models.tosca.simple.concepts;
23 import java.util.List;
25 import java.util.TreeMap;
27 import javax.persistence.Entity;
28 import javax.persistence.Inheritance;
29 import javax.persistence.InheritanceType;
30 import javax.persistence.Table;
33 import lombok.EqualsAndHashCode;
35 import org.onap.policy.models.base.PfAuthorative;
36 import org.onap.policy.models.base.PfConceptContainer;
37 import org.onap.policy.models.base.PfConceptKey;
38 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
41 * This class is a container for TOSCA data types.
43 * @author Liam Fallon (liam.fallon@est.tech)
46 @Table(name = "ToscaPolicies")
47 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
49 @EqualsAndHashCode(callSuper = true)
50 public class JpaToscaPolicies extends PfConceptContainer<JpaToscaPolicy, ToscaPolicy>
51 implements PfAuthorative<List<Map<String, ToscaPolicy>>> {
52 private static final long serialVersionUID = -7526648702327776101L;
54 public static final String DEFAULT_NAME = "ToscaPoliciesSimple";
55 public static final String DEFAULT_VERSION = "1.0.0";
58 * The Default Constructor creates a {@link JpaToscaPolicies} object with a null artifact key and creates an empty
61 public JpaToscaPolicies() {
62 super(new PfConceptKey(DEFAULT_NAME, DEFAULT_VERSION));
66 * The Key Constructor creates a {@link JpaToscaPolicies} object with the given artifact key and creates an empty
69 * @param key the concept key
71 public JpaToscaPolicies(final PfConceptKey key) {
72 super(key, new TreeMap<PfConceptKey, JpaToscaPolicy>());
76 * This Constructor creates an concept container with all of its fields defined.
78 * @param key the concept container key
79 * @param conceptMap the concepts to be stored in the concept container
81 public JpaToscaPolicies(final PfConceptKey key, final Map<PfConceptKey, JpaToscaPolicy> conceptMap) {
82 super(key, conceptMap);
88 * @param copyConcept the concept to copy from
90 public JpaToscaPolicies(final JpaToscaPolicies copyConcept) {
95 * Authorative constructor.
97 * @param authorativeConceptMapList the authorative concept to copy from
99 public JpaToscaPolicies(final List<Map<String, ToscaPolicy>> authorativeConceptMapList) {
100 this.fromAuthorative(authorativeConceptMapList);