Reorganize mappingservice.implementation
[lispflowmapping.git] / mappingservice / yangmodel / src / main / java / org / opendaylight / lispflowmapping / lisp / type / LispMessageEnum.java
1 /*
2  * Copyright (c) 2014 Contextream, 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.lispflowmapping.lisp.type;
10
11 public enum LispMessageEnum {
12     MapRequest((byte) 1), //
13     MapReply((byte) 2), //
14     MapRegister((byte) 3), //
15     MapNotify((byte) 4), //
16     MapReferral((byte) 6), //
17     Info((byte) 7), //
18     EncapsulatedControlMessage((byte) 8);
19
20     private byte value;
21
22     private LispMessageEnum(byte value) {
23         this.value = value;
24     }
25
26     public byte getValue() {
27         return value;
28     }
29
30     public static LispMessageEnum valueOf(byte i) {
31         for (LispMessageEnum lme : LispMessageEnum.values()) {
32             if (lme.getValue() == i) {
33                 return lme;
34             }
35         }
36         return null;
37     }
38 }