One more syntactic sugar - IPv4Address.withMask(IPv4Address)
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv4Address.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv4Address.java
index fab20aa..069f8b5 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv4Address.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv4Address.java
@@ -231,6 +231,20 @@
/**
* Returns an {@code IPv4AddressWithMask} object that represents this
+ * IP address masked by the given IP address mask.
+ *
+ * @param mask the {@code IPv4Address} object that represents the mask
+ * @return an {@code IPv4AddressWithMask} object that represents this
+ * IP address masked by the given mask
+ * @throws NullPointerException if the given mask was {@code null}
+ */
+ @Nonnull
+ public IPv4AddressWithMask withMask(@Nonnull final IPv4Address mask) {
+ return IPv4AddressWithMask.of(this, mask);
+ }
+
+ /**
+ * Returns an {@code IPv4AddressWithMask} object that represents this
* IP address masked by the given raw IP address mask. The argument is in
* network byte order: the highest order byte of the address is in
* {@code mask[0]}.
diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPv4AddressTest.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPv4AddressTest.java
index 9b18a62..2e6128e 100644
--- a/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPv4AddressTest.java
+++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPv4AddressTest.java
@@ -281,6 +281,10 @@
IPv4AddressWithMask v;
+ v = original.withMask(expectedMask);
+ assertEquals(v.getValue(), expectedValue);
+ assertEquals(v.getMask(), expectedMask);
+
v = original.withMask(new byte[] {-1, -1, -1, 0});
assertEquals(v.getValue(), expectedValue);
assertEquals(v.getMask(), expectedMask);