re base code
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / TargetCapabilityRelDef.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.model;
22
23 import java.util.List;
24
25 public class TargetCapabilityRelDef {
26
27     private String uid;
28     private String toNode;
29
30     private List<CapabilityRequirementRelationship> relationships;
31
32     public TargetCapabilityRelDef() {
33         super();
34     }
35
36     public TargetCapabilityRelDef(String toNode, List<CapabilityRequirementRelationship> relationships) {
37         this.toNode = toNode;
38         this.relationships = relationships;
39     }
40
41     public String getToNode() {
42         return toNode;
43     }
44
45     public void setToNode(String toNode) {
46         this.toNode = toNode;
47     }
48
49     public List<CapabilityRequirementRelationship> getRelationships() {
50         return relationships;
51     }
52
53     public CapabilityRequirementRelationship resolveSingleRelationship() {//currently only single relationship is supported
54         return relationships == null || relationships.isEmpty() ? null : relationships.get(0);
55     }
56
57     public String getUid() {
58         return uid;
59     }
60
61     public void setUid(String uid) {
62         this.uid = uid;
63     }
64
65     public void setRelationships(List<CapabilityRequirementRelationship> relationships) {
66         this.relationships = relationships;
67     }
68
69     @Override
70     public String toString() {
71         return "TargetCapabilityRelDef [ toNode=" + toNode
72                 + ", relationships=" + relationships + "]";
73     }
74
75 }