Extra route fixes
[vpnservice.git] / vpnmanager / vpnmanager-impl / src / main / java / org / opendaylight / vpnservice / ArpReplyOrRequest.java
1 /*
2  * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.vpnservice;
9
10 import org.opendaylight.vpnservice.mdsalutil.NwConstants;
11
12 public enum ArpReplyOrRequest {
13     REQUEST("ARP-REQUEST"), REPLY("ARP-REPLY");
14
15     private String name;
16
17     ArpReplyOrRequest(String name) {
18         this.name = name;
19     }
20
21     public String getName() {
22         return this.name;
23     }
24
25     public int getArpOperation(){
26         int arpOperation = (name == ArpReplyOrRequest.REQUEST.getName() ? NwConstants.ARP_REQUEST : NwConstants.ARP_REPLY);
27         return arpOperation;
28     }
29     public int calculateConsistentHashCode() {
30         if (this.name != null) {
31             return this.name.hashCode();
32         } else {
33             return 0;
34         }
35     }
36 }