Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / LagInterface.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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.onap.so.bpmn.servicedecomposition.bbobjects;
22
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.List;
26
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.annotation.JsonRootName;
29 import org.apache.commons.lang3.builder.EqualsBuilder;
30 import org.apache.commons.lang3.builder.HashCodeBuilder;
31 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
32
33 import javax.persistence.Id;
34
35 @JsonRootName("lag-interface")
36 public class LagInterface implements Serializable, ShallowCopy<LagInterface>{
37
38         private static final long serialVersionUID = -7493461787172382640L;
39
40         @Id
41         @JsonProperty("interface-name")
42     private String interfaceName;
43         @JsonProperty("interface-description")
44     private String interfaceDescription;
45         @JsonProperty("speed-value")
46     private String speedValue;
47         @JsonProperty("speed-units")
48     private String speedUnits;
49         @JsonProperty("interface-id")
50     private String interfaceId;
51         @JsonProperty("interface-role")
52     private String interfaceRole;
53         @JsonProperty("prov-status")
54     private String provStatus;
55         @JsonProperty("in-maint")
56     private boolean inMaint;
57         @JsonProperty("l-interfaces")
58     private List<LInterface> lInterfaces = new ArrayList<>();
59
60         public String getInterfaceName() {
61                 return interfaceName;
62         }
63         public void setInterfaceName(String interfaceName) {
64                 this.interfaceName = interfaceName;
65         }
66         public String getInterfaceDescription() {
67                 return interfaceDescription;
68         }
69         public void setInterfaceDescription(String interfaceDescription) {
70                 this.interfaceDescription = interfaceDescription;
71         }
72         public String getSpeedValue() {
73                 return speedValue;
74         }
75         public void setSpeedValue(String speedValue) {
76                 this.speedValue = speedValue;
77         }
78         public String getSpeedUnits() {
79                 return speedUnits;
80         }
81         public void setSpeedUnits(String speedUnits) {
82                 this.speedUnits = speedUnits;
83         }
84         public String getInterfaceId() {
85                 return interfaceId;
86         }
87         public void setInterfaceId(String interfaceId) {
88                 this.interfaceId = interfaceId;
89         }
90         public String getInterfaceRole() {
91                 return interfaceRole;
92         }
93         public void setInterfaceRole(String interfaceRole) {
94                 this.interfaceRole = interfaceRole;
95         }
96         public String getProvStatus() {
97                 return provStatus;
98         }
99         public void setProvStatus(String provStatus) {
100                 this.provStatus = provStatus;
101         }
102         public boolean isInMaint() {
103                 return inMaint;
104         }
105         public void setInMaint(boolean inMaint) {
106                 this.inMaint = inMaint;
107         }
108         public List<LInterface> getlInterfaces() {
109                 return lInterfaces;
110         }
111         @Override
112         public boolean equals(final Object other) {
113                 if (!(other instanceof LagInterface)) {
114                         return false;
115                 }
116                 LagInterface castOther = (LagInterface) other;
117                 return new EqualsBuilder().append(interfaceName, castOther.interfaceName).isEquals();
118         }
119         @Override
120         public int hashCode() {
121                 return new HashCodeBuilder().append(interfaceName).toHashCode();
122         }
123 }