Fixed a few bugs in Metadata and TransportPort value types.
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFMetadata.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFMetadata.java
index e82bc40..86799eb 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/OFMetadata.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFMetadata.java
@@ -41,4 +41,26 @@
return OFMetadata.of(this.u64.applyMask(mask.u64));
}
+ @Override
+ public boolean equals(Object arg0) {
+ if (!(arg0 instanceof OFMetadata))
+ return false;
+ OFMetadata other = (OFMetadata)arg0;
+
+ return this.u64.equals(other.u64);
+ }
+
+ @Override
+ public int hashCode() {
+ int prime = 53;
+ return this.u64.hashCode() * prime;
+ }
+
+ @Override
+ public String toString() {
+ return "Metadata: " + u64.toString();
+ }
+
+
+
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/TransportPort.java b/java_gen/pre-written/src/main/java/org/openflow/types/TransportPort.java
index 2c5687e..1ebb807 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/TransportPort.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/TransportPort.java
@@ -5,24 +5,24 @@
/**
* Represents L4 (Transport Layer) port (TCP, UDP, etc.)
- *
+ *
* @author Yotam Harchol (yotam.harchol@bigswitch.com)
*/
public class TransportPort implements OFValueType<TransportPort> {
-
+
static final int LENGTH = 2;
static final int MAX_PORT = 0xFFFF;
static final int MIN_PORT = 0;
-
- public static final TransportPort NO_MASK = TransportPort.of(0xFFFFFFFF);
+
+ public static final TransportPort NO_MASK = new TransportPort(0xFFFFFFFF);
public static final TransportPort FULL_MASK = TransportPort.of(0x0);
private final int port;
-
+
private TransportPort(int port) {
this.port = port;
}
-
+
public static TransportPort of(int port) {
if (port < MIN_PORT || port > MAX_PORT) {
throw new IllegalArgumentException("Illegal transport layer port number: " + port);
@@ -34,7 +34,7 @@
public int getLength() {
return LENGTH;
}
-
+
public int getPort() {
return port;
}
@@ -74,5 +74,5 @@
public TransportPort applyMask(TransportPort mask) {
return TransportPort.of(this.port & mask.port);
}
-
+
}