2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2020 Nordix Foundation.
4 * Modifications Copyright (C) 2020-2021 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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.models.tosca.simple.concepts;
24 import javax.persistence.Entity;
25 import javax.persistence.Inheritance;
26 import javax.persistence.InheritanceType;
27 import javax.persistence.Table;
29 import lombok.EqualsAndHashCode;
30 import lombok.NoArgsConstructor;
31 import lombok.NonNull;
32 import org.onap.policy.common.parameters.BeanValidationResult;
33 import org.onap.policy.models.base.PfConceptKey;
34 import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityType;
37 * Class to represent the capability type in TOSCA definition.
41 @Table(name = "ToscaCapabilityType")
42 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
44 @EqualsAndHashCode(callSuper = true)
46 public class JpaToscaCapabilityType extends JpaToscaWithToscaProperties<ToscaCapabilityType> {
47 private static final long serialVersionUID = -563659852901842616L;
50 * The Key Constructor creates a {@link JpaToscaCapabilityType} object with the given concept key.
54 public JpaToscaCapabilityType(@NonNull final PfConceptKey key) {
61 * @param copyConcept the concept to copy from
63 public JpaToscaCapabilityType(final JpaToscaCapabilityType copyConcept) {
68 * Authorative constructor.
70 * @param authorativeConcept the authorative concept to copy from
72 public JpaToscaCapabilityType(final ToscaCapabilityType authorativeConcept) {
73 super(authorativeConcept);
77 public ToscaCapabilityType toAuthorative() {
78 super.setToscaEntity(new ToscaCapabilityType());
79 return super.toAuthorative();
83 public BeanValidationResult validate(@NonNull String fieldName) {
84 return validateWithKey(fieldName);