2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netvirt.aclservice.api.utils;
10 import java.math.BigInteger;
11 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairs;
17 * The Class AclInterface.
19 public class AclInterface {
21 /** The port security enabled. */
22 Boolean portSecurityEnabled;
24 /** The interface id. */
27 /** The l port tag. */
33 /** The security groups. */
34 List<Uuid> securityGroups;
36 /** The allowed address pairs. */
37 List<AllowedAddressPairs> allowedAddressPairs;
40 * Checks if is port security enabled.
44 public Boolean isPortSecurityEnabled() {
45 return portSecurityEnabled;
49 * Gets the port security enabled.
51 * @return the port security enabled
53 public Boolean getPortSecurityEnabled() {
54 return portSecurityEnabled;
58 * Sets the port security enabled.
60 * @param portSecurityEnabled the new port security enabled
62 public void setPortSecurityEnabled(Boolean portSecurityEnabled) {
63 this.portSecurityEnabled = portSecurityEnabled;
67 * Gets the interface id.
69 * @return the interface id
71 public String getInterfaceId() {
76 * Sets the interface id.
78 * @param interfaceId the new interface id
80 public void setInterfaceId(String interfaceId) {
81 this.interfaceId = interfaceId;
85 * Gets the l port tag.
87 * @return the l port tag
89 public Integer getLPortTag() {
94 * Sets the l port tag.
96 * @param lportTag the new l port tag
98 public void setLPortTag(Integer lportTag) {
99 this.lportTag = lportTag;
107 public BigInteger getDpId() {
114 * @param dpId the new dp id
116 public void setDpId(BigInteger dpId) {
121 * Gets the security groups.
123 * @return the security groups
125 public List<Uuid> getSecurityGroups() {
126 return securityGroups;
130 * Sets the security groups.
132 * @param securityGroups the new security groups
134 public void setSecurityGroups(List<Uuid> securityGroups) {
135 this.securityGroups = securityGroups;
139 * Gets the allowed address pairs.
141 * @return the allowed address pairs
143 public List<AllowedAddressPairs> getAllowedAddressPairs() {
144 return allowedAddressPairs;
148 * Sets the allowed address pairs.
150 * @param allowedAddressPairs the new allowed address pairs
152 public void setAllowedAddressPairs(List<AllowedAddressPairs> allowedAddressPairs) {
153 this.allowedAddressPairs = allowedAddressPairs;
157 * @see java.lang.Object#hashCode()
160 public int hashCode() {
161 final int prime = 31;
163 result = prime * result + ((portSecurityEnabled == null) ? 0 : portSecurityEnabled.hashCode());
164 result = prime * result + ((dpId == null) ? 0 : dpId.hashCode());
165 result = prime * result + ((interfaceId == null) ? 0 : interfaceId.hashCode());
166 result = prime * result + ((lportTag == null) ? 0 : lportTag.hashCode());
167 result = prime * result + ((securityGroups == null) ? 0 : securityGroups.hashCode());
168 result = prime * result + ((allowedAddressPairs == null) ? 0 : allowedAddressPairs.hashCode());
173 * @see java.lang.Object#equals(java.lang.Object)
176 public boolean equals(Object obj) {
183 if (getClass() != obj.getClass()) {
186 AclInterface other = (AclInterface) obj;
187 if (portSecurityEnabled == null) {
188 if (other.portSecurityEnabled != null) {
191 } else if (!portSecurityEnabled.equals(other.portSecurityEnabled)) {
195 if (other.dpId != null) {
198 } else if (!dpId.equals(other.dpId)) {
201 if (interfaceId == null) {
202 if (other.interfaceId != null) {
205 } else if (!interfaceId.equals(other.interfaceId)) {
208 if (lportTag == null) {
209 if (other.lportTag != null) {
212 } else if (!lportTag.equals(other.lportTag)) {
215 if (securityGroups == null) {
216 if (other.securityGroups != null) {
219 } else if (!securityGroups.equals(other.securityGroups)) {
222 if (allowedAddressPairs == null) {
223 if (other.allowedAddressPairs != null) {
226 } else if (!allowedAddressPairs.equals(other.allowedAddressPairs)) {
233 * @see java.lang.Object#toString()
236 public String toString() {
237 return "AclInterface [portSecurityEnabled=" + portSecurityEnabled + ", interfaceId=" + interfaceId
238 + ", lportTag=" + lportTag + ", dpId=" + dpId + ", securityGroups=" + securityGroups
239 + ", allowedAddressPairs=" + allowedAddressPairs + "]";