org.requirementsascode.act.statemachine.ConsumeWith Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of act Show documentation
Show all versions of act Show documentation
A language for state charts, workflows and more.
package org.requirementsascode.act.statemachine;
import static java.util.Objects.requireNonNull;
import static org.requirementsascode.act.core.Data.data;
import java.util.function.BiFunction;
import org.requirementsascode.act.core.Behavior;
public class ConsumeWith{
public static Behavior consumeWith(BiFunction consumer){
requireNonNull(consumer, "consumer must be non-null!");
return i -> data(consumer.apply(i.state(), i.value()), i.value());
}
}