java_gen: make factories version aware
diff --git a/java_gen/templates/of_factory_class.java b/java_gen/templates/of_factory_class.java
index 395b524..eef1e04 100644
--- a/java_gen/templates/of_factory_class.java
+++ b/java_gen/templates/of_factory_class.java
@@ -170,4 +170,7 @@
     }
 //:: #endif
 
+    public OFVersion getVersion() {
+            return OFVersion.${factory.version.constant_version};
+    }
 }
diff --git a/java_gen/templates/of_factory_interface.java b/java_gen/templates/of_factory_interface.java
index 6a92e96..3d0d5af 100644
--- a/java_gen/templates/of_factory_interface.java
+++ b/java_gen/templates/of_factory_interface.java
@@ -60,6 +60,8 @@
 
     OFMessageReader<${factory.base_class}> getReader();
 
+    OFVersion getVersion();
+
 //:: if factory.name == 'OFOxms':
     public <F extends OFValueType<F>> OFOxm<F> fromValue(F value, MatchField<F> field);
     public <F extends OFValueType<F>> OFOxm<F> fromValueAndMask(F value, F mask, MatchField<F> field);