java_gen: create DEFAULT instance for objects that support it (for Match)
Objects which consist only of parts that have a default value
now get a default value.
Match, in particular, now defines a default instance that wildcards
everything and is available as factory.matchWildcardAll()
diff --git a/java_gen/templates/of_factory_class.java b/java_gen/templates/of_factory_class.java
index 5263226..395b524 100644
--- a/java_gen/templates/of_factory_class.java
+++ b/java_gen/templates/of_factory_class.java
@@ -72,6 +72,12 @@
public Match.Builder buildMatch() {
return new ${i.versioned_class(factory.version).name}.Builder();
}
+
+ final static Match MATCH_WILDCARD_ALL = ${i.versioned_class(factory.version).name}.DEFAULT;
+
+ public Match matchWildcardAll() {
+ return MATCH_WILDCARD_ALL;
+ }
//:: general_get_match_func_written = True
//:: #endif
//:: if len(i.writeable_members) <= 2: