2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.be.model;
23 import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition;
25 public class RelationshipInfo {
27 private String requirement;
28 private String capabilityOwnerId;
29 private String requirementOwnerId;
32 private RelationshipImpl relationship;
34 private String capability;
36 private String capabilityUid;
37 private String requirementUid;
39 public RelationshipInfo() {
43 public RelationshipInfo(String requirement, RelationshipImpl relationship) {
45 this.requirement = requirement;
46 this.relationship = relationship;
49 public RelationshipInfo(String requirement, RelationshipImpl relationship, String capability) {
51 this.requirement = requirement;
52 this.relationship = relationship;
53 this.capability = capability;
56 public String getRequirement() {
60 public void setRequirement(String requirement) {
61 this.requirement = requirement;
64 public String getCapabilityOwnerId() {
65 return capabilityOwnerId;
68 public void setCapabilityOwnerId(String capabilityOwnerId) {
69 this.capabilityOwnerId = capabilityOwnerId;
72 public String getRequirementOwnerId() {
73 return requirementOwnerId;
76 public void setRequirementOwnerId(String requirementOwnerId) {
77 this.requirementOwnerId = requirementOwnerId;
80 public RelationshipImpl getRelationship() {
84 public void setRelationships(RelationshipImpl relationship) {
85 this.relationship = relationship;
88 public String getCapability() {
92 public void setCapability(String capability) {
93 this.capability = capability;
96 public String getCapabilityUid() {
100 public void setCapabilityUid(String capabilityUid) {
101 this.capabilityUid = capabilityUid;
104 public String getRequirementUid() {
105 return requirementUid;
108 public void setRequirementUid(String requirementUid) {
109 this.requirementUid = requirementUid;
112 public String getId() {
116 public void setId(String id) {
121 public String toString() {
122 return "RequirementAndRelationshipPair [requirement=" + requirement + ", relationship=" + relationship
123 + ", capability=" + capability + "]";
126 public boolean equalsTo( RelationshipInstDataDefinition savedRelation){
127 if ( savedRelation == null ){
130 if(getRelationship().getType() == null ){
131 if(savedRelation.getType() != null){
136 if ( !savedRelation.getType().equals(this.getRelationship().getType()) ){
140 if ( !savedRelation.getCapabilityOwnerId().equals(this.getCapabilityOwnerId()) ){
143 if ( !savedRelation.getRequirementOwnerId().equals(this.getRequirementOwnerId()) ){
146 if ( !savedRelation.getRequirementId().equals(this.getRequirementUid()) ){
149 if ( !savedRelation.getCapabilityId().equals(this.getCapabilityUid()) ){
152 if ( !savedRelation.getRequirement().equals(this.getRequirement()) ){