189ad436d4ee1e5cc8e2c21105578642523bee2f
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / md / util / OpenflowVersion.java
1 package org.opendaylight.openflowplugin.api.openflow.md.util;
2
3 /**
4  * @deprecated enum in api is not something what we would like to see in case it is evolving
5  * TODO: remove class for lithium release
6  *
7  * List of Openflow versions supported by the plugin
8  * Note: If you add a version here, make sure to update org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil as well.
9  * Created by kramesha on 5/2/14.
10  */
11 public enum OpenflowVersion {
12
13     OF10((short)0x01),
14     OF13((short)0x04),
15     UNSUPPORTED((short)0x00);
16
17
18     private short version;
19
20     OpenflowVersion(final short version) {
21         this.version = version;
22     }
23
24     public static OpenflowVersion get(final Short version) {
25         for (final OpenflowVersion ofv : OpenflowVersion.values()) {
26             if (ofv.version == version) {
27                 return ofv;
28             }
29         }
30         return UNSUPPORTED;
31     }
32
33     /**
34      * @return the version
35      */
36     public short getVersion() {
37         return version;
38     }
39
40 }