java_gen/prewritten: add 'ZERO/NONE' values to OFValueTypes
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VlanVid.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VlanVid.java
index 63b8831..5c23779 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VlanVid.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VlanVid.java
@@ -6,8 +6,10 @@
public class VlanVid implements OFValueType<VlanVid> {
private static final short VALIDATION_MASK = 0x0FFF;
+ private static final short NONE_VAL = 0x0000;
final static int LENGTH = 2;
+ public static final VlanVid NONE = new VlanVid(NONE_VAL);
public static final VlanVid NO_MASK = new VlanVid((short)0xFFFF);
public static final VlanVid FULL_MASK = VlanVid.of((short)0x0);
@@ -18,7 +20,9 @@
}
public static VlanVid of(short vid) {
- if ((vid & VALIDATION_MASK) != vid)
+ if(vid == NONE_VAL)
+ return NONE;
+ else if ((vid & VALIDATION_MASK) != vid)
throw new IllegalArgumentException("Illegal VLAN VID value: " + vid);
return new VlanVid(vid);
}