X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2FOFPErrorType.java;fp=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2FOFPErrorType.java;h=0000000000000000000000000000000000000000;hb=64fe0fbca1a6c2b77ad25f568d73a7eb64236d16;hp=eb1058d6dff692a72de3a3a9f10246dc6c75810d;hpb=8b9a3ff2bbc83941254b46b818cbbae5cc1a3a5b;p=openflowjava.git diff --git a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPErrorType.java b/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPErrorType.java deleted file mode 100644 index eb1058d6..00000000 --- a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPErrorType.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.openflow.codec.protocol; - -import java.util.HashMap; -import java.util.Map; - -import org.openflow.codec.util.U16; - -/** - * enum correspond to ofp_error_type - * - * @author AnilGujele - * - */ -public enum OFPErrorType -{ - OFPET_HELLO_FAILED(0), OFPET_BAD_REQUEST(1), OFPET_BAD_ACTION(2), OFPET_BAD_INSTRUCTION( - 3), OFPET_BAD_MATCH(4), OFPET_FLOW_MOD_FAILED(5), OFPET_GROUP_MOD_FAILED( - 6), OFPET_PORT_MOD_FAILED(7), OFPET_TABLE_MOD_FAILED(8), OFPET_QUEUE_OP_FAILED( - 9), OFPET_SWITCH_CONFIG_FAILED(10), OFPET_ROLE_REQUEST_FAILED(11), OFPET_METER_MOD_FAILED( - 12), OFPET_TABLE_FEATURES_FAILED(13), OFPET_EXPERIMENTER(0xffff); - - private static Map mapping; - - private short type; - - OFPErrorType(int type) - { - this.type = (short) type; - addMapping(type, this); - } - - /** - * add mapping for OFPErrorType - * - * @param type - * @param errorType - */ - private static void addMapping(int type, OFPErrorType errorType) - { - if (null == mapping) - { - mapping = new HashMap(); - } - mapping.put(type, errorType); - } - - /** - * get the OFPErrorType of value - * - * @param type - * @return - */ - public static OFPErrorType valueOf(short type) - { - return mapping.get(U16.f(type)); - } - - /** - * get type value - * - * @return - */ - public short getValue() - { - return type; - } - -}