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;
39 /** The port is marked for delete. */
40 Boolean isMarkedForDelete = false;
43 * Checks if is port security enabled.
47 public Boolean isPortSecurityEnabled() {
48 return portSecurityEnabled;
52 * Gets the port security enabled.
54 * @return the port security enabled
56 public Boolean getPortSecurityEnabled() {
57 return portSecurityEnabled;
61 * Sets the port security enabled.
63 * @param portSecurityEnabled the new port security enabled
65 public void setPortSecurityEnabled(Boolean portSecurityEnabled) {
66 this.portSecurityEnabled = portSecurityEnabled;
70 * Gets the interface id.
72 * @return the interface id
74 public String getInterfaceId() {
79 * Sets the interface id.
81 * @param interfaceId the new interface id
83 public void setInterfaceId(String interfaceId) {
84 this.interfaceId = interfaceId;
88 * Gets the l port tag.
90 * @return the l port tag
92 public Integer getLPortTag() {
97 * Sets the l port tag.
99 * @param lportTag the new l port tag
101 public void setLPortTag(Integer lportTag) {
102 this.lportTag = lportTag;
110 public BigInteger getDpId() {
117 * @param dpId the new dp id
119 public void setDpId(BigInteger dpId) {
124 * Gets the security groups.
126 * @return the security groups
128 public List<Uuid> getSecurityGroups() {
129 return securityGroups;
133 * Sets the security groups.
135 * @param securityGroups the new security groups
137 public void setSecurityGroups(List<Uuid> securityGroups) {
138 this.securityGroups = securityGroups;
142 * Gets the allowed address pairs.
144 * @return the allowed address pairs
146 public List<AllowedAddressPairs> getAllowedAddressPairs() {
147 return allowedAddressPairs;
151 * Sets the allowed address pairs.
153 * @param allowedAddressPairs the new allowed address pairs
155 public void setAllowedAddressPairs(List<AllowedAddressPairs> allowedAddressPairs) {
156 this.allowedAddressPairs = allowedAddressPairs;
160 * Retrieve isMarkedForDelete.
161 * @return the whether it is marked for delete
163 public Boolean isMarkedForDelete() {
164 return isMarkedForDelete;
168 * Sets isMarkedForDelete.
169 * @param isMarkedForDelete boolean value
171 public void setIsMarkedForDelete(Boolean isMarkedForDelete) {
172 this.isMarkedForDelete = isMarkedForDelete;
176 * @see java.lang.Object#hashCode()
179 public int hashCode() {
180 final int prime = 31;
182 result = prime * result + ((portSecurityEnabled == null) ? 0 : portSecurityEnabled.hashCode());
183 result = prime * result + ((dpId == null) ? 0 : dpId.hashCode());
184 result = prime * result + ((interfaceId == null) ? 0 : interfaceId.hashCode());
185 result = prime * result + ((lportTag == null) ? 0 : lportTag.hashCode());
186 result = prime * result + ((securityGroups == null) ? 0 : securityGroups.hashCode());
187 result = prime * result + ((allowedAddressPairs == null) ? 0 : allowedAddressPairs.hashCode());
188 result = prime * result + ((isMarkedForDelete == null) ? 0 : isMarkedForDelete.hashCode());
193 * @see java.lang.Object#equals(java.lang.Object)
196 public boolean equals(Object obj) {
203 if (getClass() != obj.getClass()) {
206 AclInterface other = (AclInterface) obj;
207 if (portSecurityEnabled == null) {
208 if (other.portSecurityEnabled != null) {
211 } else if (!portSecurityEnabled.equals(other.portSecurityEnabled)) {
215 if (other.dpId != null) {
218 } else if (!dpId.equals(other.dpId)) {
221 if (interfaceId == null) {
222 if (other.interfaceId != null) {
225 } else if (!interfaceId.equals(other.interfaceId)) {
228 if (lportTag == null) {
229 if (other.lportTag != null) {
232 } else if (!lportTag.equals(other.lportTag)) {
235 if (securityGroups == null) {
236 if (other.securityGroups != null) {
239 } else if (!securityGroups.equals(other.securityGroups)) {
242 if (allowedAddressPairs == null) {
243 if (other.allowedAddressPairs != null) {
246 } else if (!allowedAddressPairs.equals(other.allowedAddressPairs)) {
249 if (isMarkedForDelete == null) {
250 if (other.isMarkedForDelete != null) {
253 } else if (!isMarkedForDelete.equals(other.isMarkedForDelete)) {
260 * @see java.lang.Object#toString()
263 public String toString() {
264 return "AclInterface [portSecurityEnabled=" + portSecurityEnabled + ", interfaceId=" + interfaceId
265 + ", lportTag=" + lportTag + ", dpId=" + dpId + ", securityGroups=" + securityGroups
266 + ", allowedAddressPairs=" + allowedAddressPairs + ", isMarkedForDelete=" + isMarkedForDelete + "]";