Added methods to DatapathId to get/set by byte array
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/DatapathId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/DatapathId.java
index ad86d29..f58d658 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/DatapathId.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/DatapathId.java
@@ -2,6 +2,7 @@
import org.projectfloodlight.openflow.util.HexString;
+import com.google.common.primitives.Longs;
import com.google.common.primitives.UnsignedLongs;
/**
@@ -28,6 +29,10 @@
return new DatapathId(HexString.toLong(s));
}
+ public static DatapathId of(byte[] bytes) {
+ return new DatapathId(Longs.fromByteArray(bytes));
+ }
+
public long getLong() {
return rawValue;
}
@@ -36,6 +41,10 @@
return U64.of(rawValue);
}
+ public byte[] getBytes() {
+ return Longs.toByteArray(rawValue);
+ }
+
@Override
public String toString() {
return HexString.toHexString(rawValue);