2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
10 import java.util.HashMap;
18 //TODO make a model in YANG for protocols
19 public enum IPProtocols {
25 private short protocol;
27 private static Map<Short, IPProtocols> valueMap;
29 valueMap = new HashMap<>();
30 for(IPProtocols protocols : IPProtocols.values()) {
31 valueMap.put(protocols.protocol, protocols);
35 private IPProtocols(short value) {
36 this.protocol = value;
39 private byte getValue() {
40 return (byte) this.protocol;
43 public static IPProtocols fromProtocolNum(Short protocolNum) {
44 return valueMap.get(protocolNum);