Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / PhysicalLink.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 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.onap.so.bpmn.servicedecomposition.bbobjects;
22
23 import java.io.Serializable;
24
25 import javax.persistence.Id;
26
27 import org.apache.commons.lang3.builder.EqualsBuilder;
28 import org.apache.commons.lang3.builder.HashCodeBuilder;
29 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
30
31 import com.fasterxml.jackson.annotation.JsonProperty;
32 import com.fasterxml.jackson.annotation.JsonRootName;
33
34 @JsonRootName("physical-link")
35 public class PhysicalLink implements Serializable, ShallowCopy<PhysicalLink> {
36
37         private static final long serialVersionUID = -6378347998443741227L;
38
39         @Id
40     @JsonProperty("link-name")
41         private String linkName;
42     @JsonProperty("interface-name")
43         private String interfaceName;
44     @JsonProperty("service-provider-name")
45         private String serviceProviderName;
46     @JsonProperty("circuit-id")
47         private String circuitId;
48     @JsonProperty("management-option")
49         private String managementOption;
50     @JsonProperty("bandwidth-up")
51         private int bandwidthUp;
52     @JsonProperty("bandwidth-down")
53         private int bandwidthDown;
54     @JsonProperty("bandwidth-units")
55         private String bandwidthUnits;
56     @JsonProperty("wan-port")
57         private String wanPort;
58
59
60         public String getLinkName(){
61                 return linkName;
62         }
63
64         public void setLinkName(String linkName){
65                 this.linkName = linkName;
66         }
67
68         public String getInterfaceName(){
69                 return interfaceName;
70         }
71
72         public void setInterfaceName(String interfaceName){
73                 this.interfaceName = interfaceName;
74         }
75
76
77         public String getServiceProviderName(){
78                 return serviceProviderName;
79         }
80
81
82         public void setServiceProviderName(String serviceProviderName){
83                 this.serviceProviderName = serviceProviderName;
84         }
85
86         public String getCircuitId(){
87                 return circuitId;
88         }
89
90         public void setCircuitId(String circuitId){
91                 this.circuitId = circuitId;
92         }
93
94         public String getManagementOption(){
95                 return managementOption;
96         }
97
98         public void setManagementOption(String managementOption){
99                 this.managementOption = managementOption;
100         }
101
102         public int getBandwidthUp(){
103                 return bandwidthUp;
104         }
105
106         public void setBandwidthUp(int bandwidthUp){
107                 this.bandwidthUp = bandwidthUp;
108         }
109
110         public int getBandwidthDown(){
111                 return bandwidthDown;
112         }
113
114         public void setBandwidthDown(int bandwidthDown){
115                 this.bandwidthDown = bandwidthDown;
116         }
117
118         public String getBandwidthUnits(){
119                 return bandwidthUnits;
120         }
121
122         public void setBandwidthUnits(String bandwidthUnits){
123                 this.bandwidthUnits = bandwidthUnits;
124         }
125
126         public String getWanPort(){
127                 return wanPort;
128         }
129
130         public void setWanPort(String wanPort){
131                 this.wanPort = wanPort;
132         }
133
134
135         @Override
136         public boolean equals(final Object other){
137                 if(!(other instanceof PhysicalLink)){
138                         return false;
139                 }
140                 PhysicalLink castOther = (PhysicalLink) other;
141                 return new EqualsBuilder().append(linkName, castOther.linkName).isEquals();
142         }
143
144         @Override
145         public int hashCode(){
146                 return new HashCodeBuilder().append(linkName).toHashCode();
147         }
148
149 }