Use YANG java files instead of the old model TELSDN-474 #close
[lispflowmapping.git] / mappingservice / api / src / main / java / org / opendaylight / lispflowmapping / type / AddressFamilyNumberEnum.java
1 /*
2  * Copyright (c) 2013 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.type;
10
11 public enum AddressFamilyNumberEnum {
12     NO_ADDRESS(0), //
13     IP(1), //
14     IP6(2), //
15     DISTINGUISHED_NAME(17), //
16     AS(18), //
17     LCAF(16387), //
18     MAC(16389), //
19     UNKNOWN(-1);
20
21     private short ianaCode;
22
23     private AddressFamilyNumberEnum(int ianaCode) {
24         this.ianaCode = (short) ianaCode;
25     }
26
27     public short getIanaCode() {
28         return ianaCode;
29     }
30
31     public static AddressFamilyNumberEnum valueOf(short ianaCode) {
32         for (AddressFamilyNumberEnum val : values()) {
33             if (val.getIanaCode() == ianaCode) {
34                 return val;
35             }
36         }
37         return UNKNOWN;
38     }
39 }