BUG 2302 : odl-clustering-test-app should not be part of the odl-restconf-all feature set
[controller.git] / opendaylight / arphandler / src / main / java / org / opendaylight / controller / arphandler / ARPCacheEvent.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.arphandler;
11
12 public class ARPCacheEvent {
13     private ARPEvent event;
14     private boolean newReply;
15
16     public ARPCacheEvent(ARPEvent event, boolean newReply) {
17         super();
18         this.event = event;
19         this.newReply = newReply;
20     }
21
22     public ARPEvent getEvent() {
23         return event;
24     }
25
26     public boolean isNewReply() {
27         return newReply;
28     }
29
30     @Override
31     public int hashCode() {
32         final int prime = 31;
33         int result = 1;
34         result = prime * result + ((event == null) ? 0 : event.hashCode());
35         result = prime * result + (newReply ? 1231 : 1237);
36         return result;
37     }
38
39     @Override
40     public boolean equals(Object obj) {
41         if (this == obj)
42             return true;
43         if (obj == null)
44             return false;
45         if (getClass() != obj.getClass())
46             return false;
47         ARPCacheEvent other = (ARPCacheEvent) obj;
48         if (event == null) {
49             if (other.event != null)
50                 return false;
51         } else if (!event.equals(other.event))
52             return false;
53         if (newReply != other.newReply)
54             return false;
55         return true;
56     }
57
58     @Override
59     public String toString() {
60         return "ARPCacheEvent [event=" + event + ", newReply=" + newReply + "]";
61     }
62 }