java_gen: value types: add NO_MASK, FULL_MASK constants where missing
This is necessary so types can distinguish non-canonical forms.
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
index b082f8b..7d7c38e 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
@@ -14,6 +14,10 @@
private final static int NONE_VAL = 0;
public final static ClassId NONE = new ClassId(NONE_VAL);
+ private final static int NO_MASK_VAL = 0xFFFFFFFF;
+ public final static ClassId NO_MASK = new ClassId(NO_MASK_VAL);
+ public final static ClassId FULL_MASK = NONE;
+
private final int rawValue;
private ClassId(final int rawValue) {
@@ -23,7 +27,8 @@
public static ClassId of(final int raw) {
if(raw == NONE_VAL)
return NONE;
-
+ else if(raw == NO_MASK_VAL)
+ return NO_MASK;
return new ClassId(raw);
}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/LagId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/LagId.java
index 6d9421a..51364e1 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/LagId.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/LagId.java
@@ -15,11 +15,19 @@
private final static int NONE_VAL = 0;
public final static LagId NONE = new LagId(NONE_VAL);
+ private final static int NO_MASK_VAL = 0xFFFFFFFF;
+ public final static LagId NO_MASK = new LagId(NO_MASK_VAL);
+ public final static LagId FULL_MASK = NONE;
+
private LagId(final int rawValue) {
this.rawValue = rawValue;
}
public static LagId of(final int raw) {
+ if(raw == NONE_VAL)
+ return NONE;
+ else if (raw == NO_MASK_VAL)
+ return NO_MASK;
return new LagId(raw);
}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBitMask128.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBitMask128.java
index 5cec233..051d573 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBitMask128.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBitMask128.java
@@ -14,6 +14,9 @@
public static final OFBitMask128 ALL = new OFBitMask128(-1, -1);
public static final OFBitMask128 NONE = new OFBitMask128(0, 0);
+ public static final OFBitMask128 NO_MASK = ALL;
+ public static final OFBitMask128 FULL_MASK = NONE;
+
private OFBitMask128(long raw1, long raw2) {
this.raw1 = raw1;
this.raw2 = raw2;
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBooleanValue.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBooleanValue.java
index b386e54..e276092 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBooleanValue.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBooleanValue.java
@@ -28,6 +28,9 @@
public final static OFBooleanValue TRUE = new OFBooleanValue(true);
public final static OFBooleanValue FALSE = new OFBooleanValue(false);
+ public final static OFBooleanValue NO_MASK = TRUE;
+ public final static OFBooleanValue FULL_MASK = FALSE;
+
private final boolean value;
private OFBooleanValue(boolean value) {
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U32.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U32.java
index 9fafc30..7f53374 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U32.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U32.java
@@ -29,6 +29,10 @@
private final static int ZERO_VAL = 0;
public final static U32 ZERO = new U32(ZERO_VAL);
+ private static final int NO_MASK_VAL = 0xFFffFFff;
+ public final static U32 NO_MASK = new U32(NO_MASK_VAL);
+ public static final U32 FULL_MASK = ZERO;
+
private final int raw;
private U32(int raw) {
@@ -42,6 +46,8 @@
public static U32 ofRaw(int raw) {
if(raw == ZERO_VAL)
return ZERO;
+ if(raw == NO_MASK_VAL)
+ return NO_MASK;
return new U32(raw);
}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U8.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U8.java
index 078a846..c644599 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U8.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U8.java
@@ -29,6 +29,10 @@
private final static byte ZERO_VAL = 0;
public final static U8 ZERO = new U8(ZERO_VAL);
+ private static final byte NO_MASK_VAL = (byte) 0xFF;
+ public static final U8 NO_MASK = new U8(NO_MASK_VAL);
+ public static final U8 FULL_MASK = ZERO;
+
private final byte raw;
private U8(byte raw) {
@@ -38,6 +42,8 @@
public static final U8 of(short value) {
if(value == ZERO_VAL)
return ZERO;
+ if(value == NO_MASK_VAL)
+ return NO_MASK;
return new U8(t(value));
}