Reformat catalog-model
[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 package org.openecomp.sdc.be.model;
17
18 import java.util.Map;
19 import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition;
20 import org.openecomp.sdc.be.resources.data.RelationshipTypeData;
21
22 /**
23  * Specifies the capabilities that the Node Type exposes.
24  */
25 public class RelationshipTypeDefinition extends RelationshipInstDataDefinition {
26
27     private String derivedFrom;
28     private Map<String, PropertyDefinition> properties;
29
30     public RelationshipTypeDefinition() {
31         super();
32     }
33
34     public RelationshipTypeDefinition(RelationshipInstDataDefinition p) {
35         super(p);
36     }
37
38     public RelationshipTypeDefinition(RelationshipTypeData relationshipTypeData) {
39         this.setUniqueId(relationshipTypeData.getUniqueId());
40         this.setType(relationshipTypeData.getRelationshipTypeDataDefinition().getType());
41         this.setDescription(relationshipTypeData.getRelationshipTypeDataDefinition().getDescription());
42         this.setValidSourceTypes(relationshipTypeData.getRelationshipTypeDataDefinition().getValidSourceTypes());
43     }
44
45     public String getDerivedFrom() {
46         return derivedFrom;
47     }
48
49     public void setDerivedFrom(String derivedFrom) {
50         this.derivedFrom = derivedFrom;
51     }
52
53     public Map<String, PropertyDefinition> getProperties() {
54         return properties;
55     }
56
57     public void setProperties(Map<String, PropertyDefinition> properties) {
58         this.properties = properties;
59     }
60
61     @Override
62     public String toString() {
63         return super.toString() + " [ derivedFrom=" + derivedFrom + ", properties=" + properties + " ]";
64     }
65 }