Construct AfterFirstStateMachine with a list of subtriggers

Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/77332f1e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/77332f1e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/77332f1e

Branch: refs/heads/master
Commit: 77332f1e612caf9090e148e1493c11ca8e753076
Parents: b2bb7c0
Author: Kenneth Knowles <k...@google.com>
Authored: Thu Oct 13 20:43:08 2016 -0700
Committer: Kenneth Knowles <k...@google.com>
Committed: Mon Oct 17 19:56:35 2016 -0700

----------------------------------------------------------------------
 .../beam/runners/core/triggers/AfterFirstStateMachine.java     | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/77332f1e/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterFirstStateMachine.java
----------------------------------------------------------------------
diff --git 
a/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterFirstStateMachine.java
 
b/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterFirstStateMachine.java
index 272c278..f4b305e 100644
--- 
a/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterFirstStateMachine.java
+++ 
b/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterFirstStateMachine.java
@@ -20,6 +20,7 @@ package org.apache.beam.runners.core.triggers;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableList;
 import java.util.Arrays;
 import java.util.List;
 import 
org.apache.beam.runners.core.triggers.TriggerStateMachine.OnceTriggerStateMachine;
@@ -46,6 +47,11 @@ public class AfterFirstStateMachine extends 
OnceTriggerStateMachine {
     return new 
AfterFirstStateMachine(Arrays.<TriggerStateMachine>asList(triggers));
   }
 
+  public static OnceTriggerStateMachine of(
+      Iterable<? extends TriggerStateMachine> triggers) {
+    return new AfterFirstStateMachine(ImmutableList.copyOf(triggers));
+  }
+
   @Override
   public void onElement(OnElementContext c) throws Exception {
     for (ExecutableTriggerStateMachine subTrigger : c.trigger().subTriggers()) 
{

Reply via email to