Match field iteration
diff --git a/java_gen/templates/custom/OFMatchV3Ver13.java b/java_gen/templates/custom/OFMatchV3Ver13.java
index 8955e1e..9bfb234 100644
--- a/java_gen/templates/custom/OFMatchV3Ver13.java
+++ b/java_gen/templates/custom/OFMatchV3Ver13.java
@@ -108,3 +108,31 @@
return oxm != null && oxm.isMasked();
}
+
+ private class MatchFieldIterator extends UnmodifiableIterator<MatchField<?>> {
+ private Iterator<OFOxm<?>> oxmIterator;
+
+ MatchFieldIterator() {
+ oxmIterator = oxmList.iterator();
+ }
+
+ @Override
+ public boolean hasNext() {
+ return oxmIterator.hasNext();
+ }
+
+ @Override
+ public MatchField<?> next() {
+ OFOxm<?> next = oxmIterator.next();
+ return next.getMatchField();
+ }
+ }
+
+ @Override
+ public Iterable<MatchField<?>> getMatchFields() {
+ return new Iterable<MatchField<?>>() {
+ public Iterator<MatchField<?>> iterator() {
+ return new MatchFieldIterator();
+ }
+ };
+ }