Requirement and capabilities feature
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / RelationshipTypeDefinition.java
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 package org.openecomp.sdc.be.model;
19
20 import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition;
21 import org.openecomp.sdc.be.resources.data.RelationshipTypeData;
22
23 import java.util.Map;
24
25 /**
26  * Specifies the capabilities that the Node Type exposes.
27  */
28 public class RelationshipTypeDefinition extends RelationshipInstDataDefinition {
29
30     private String derivedFrom;
31
32     private Map<String, PropertyDefinition> properties;
33
34     public RelationshipTypeDefinition() {
35         super();
36     }
37
38     public RelationshipTypeDefinition(RelationshipInstDataDefinition p) {
39         super(p);
40     }
41
42     public RelationshipTypeDefinition(RelationshipTypeData relationshipTypeData) {
43         this.setUniqueId(relationshipTypeData.getUniqueId());
44         this.setType(relationshipTypeData.getRelationshipTypeDataDefinition().getType());
45         this.setDescription(relationshipTypeData.getRelationshipTypeDataDefinition().getDescription());
46         this.setValidSourceTypes(relationshipTypeData.getRelationshipTypeDataDefinition().getValidSourceTypes());
47     }
48
49     public String getDerivedFrom() {
50         return derivedFrom;
51     }
52
53     public void setDerivedFrom(String derivedFrom) {
54         this.derivedFrom = derivedFrom;
55     }
56
57     public Map<String, PropertyDefinition> getProperties() {
58         return properties;
59     }
60
61     public void setProperties(Map<String, PropertyDefinition> properties) {
62         this.properties = properties;
63     }
64
65     @Override
66     public String toString() {
67         return super.toString() + " [ derivedFrom=" + derivedFrom + ", properties=" + properties + " ]";
68     }
69 }