Merge "Sonar clean-up: OF13Provider"
[ovsdb.git] / openstack / net-virt-providers / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / providers / openflow13 / services / arp / ArpOperation.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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
9 package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
10
11 import javax.annotation.Nullable;
12
13 public enum ArpOperation {
14
15     REQUEST(1), REPLY(2);
16
17     private final int intOperation;
18
19     private ArpOperation(int operationNumber) {
20         this.intOperation = operationNumber;
21     }
22
23     public int intValue() {
24         return intOperation;
25     }
26
27     public static @Nullable ArpOperation loadFromInt(int intOperation) {
28         for (ArpOperation operation : ArpOperation.values()) {
29             if (operation.intOperation == intOperation) {
30                 return operation;
31             }
32         }
33         return null;
34     }
35 }