X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2FOFPHelloElemType.java;fp=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2FOFPHelloElemType.java;h=0000000000000000000000000000000000000000;hb=64fe0fbca1a6c2b77ad25f568d73a7eb64236d16;hp=488b24ae114491d4c7e8af7e69e82c9322786290;hpb=8b9a3ff2bbc83941254b46b818cbbae5cc1a3a5b;p=openflowjava.git diff --git a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPHelloElemType.java b/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPHelloElemType.java deleted file mode 100644 index 488b24ae..00000000 --- a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPHelloElemType.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openflow.codec.protocol; - -import java.util.HashMap; -import java.util.Map; - -/** - * Represents struct ofp_hello_elem_type - * - * @author AnilGujele - * - */ -public enum OFPHelloElemType { - /* Bitmap of version supported. */ - VERSIONBITMAP((short) 1, new Instantiable() { - @Override - public OFPHelloElemHeader instantiate() { - return new OFPHelloElemVersionBitmap(); - } - }); - - private static Map mapping; - - private short type; - - private Instantiable instantiable; - - /** - * - * @param type - */ - OFPHelloElemType(short type, Instantiable instantiable) { - this.setTypeValue(type); - OFPHelloElemType.addMapping(type, this); - this.instantiable = instantiable; - } - - /** - * add mapping to store - * - * @param type - * @param helloElementType - */ - private static void addMapping(short type, OFPHelloElemType helloElementType) { - if (null == mapping) { - mapping = new HashMap(); - } - mapping.put(type, helloElementType); - } - - /** - * get OFHelloElementType correspond to value type - * - * @param type - * @return OFHelloElementType - */ - public static OFPHelloElemType valueOf(short type) { - return mapping.get(type); - } - - /** - * get HelloElement type value - * - * @return - */ - public short getTypeValue() { - return type; - } - - /** - * set HelloElement type value - * - * @param type - */ - public void setTypeValue(short type) { - this.type = type; - } - - /** - * Returns a new instance of the OFPHelloElemHeader represented by this - * OFPHelloElemType - * - * @return the new object - */ - public OFPHelloElemHeader newInstance() { - return instantiable.instantiate(); - } - -}