2 * Copyright (c) 2015 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.vpnmanager.iplearn.model;
10 import java.net.InetAddress;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
13 public class MacEntry {
14 private String vpnName;
15 private final MacAddress macAddress;
16 private final InetAddress ipAddress;
17 private String interfaceName;
18 private final String createdTime;
20 public MacEntry(String vpnName, MacAddress macAddress, InetAddress inetAddress,
21 String interfaceName, String createdTime) {
22 this.vpnName = vpnName;
23 this.macAddress = macAddress;
24 this.ipAddress = inetAddress;
25 this.interfaceName = interfaceName;
26 this.createdTime = createdTime;
29 public String getVpnName() {
33 public void setVpnName(String vpnName) {
34 this.vpnName = vpnName;
37 public MacAddress getMacAddress() {
41 public String getInterfaceName() {
45 public void setInterfaceName(String interfaceName) {
46 this.interfaceName = interfaceName;
49 public InetAddress getIpAddress() {
53 public String getCreatedTime() {
58 public int hashCode() {
61 result = prime * result
62 + (macAddress == null ? 0 : macAddress.hashCode());
67 public boolean equals(Object obj) {
72 if (getClass() != obj.getClass()) {
75 MacEntry other = (MacEntry) obj;
76 return vpnName.equals(other.vpnName)
77 && macAddress.equals(other.macAddress)
78 && ipAddress.equals(other.ipAddress)
79 && interfaceName.equals(other.interfaceName)
80 && createdTime.equals(other.getCreatedTime());
85 public String toString() {
86 return "MacEntry [vpnName=" + vpnName + ", macAddress=" + macAddress + ", ipAddress=" + ipAddress
87 + ", interfaceName=" + interfaceName + ", createdTime=" + createdTime + "]";