All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.requirementsascode.act.statemachine.ConsumeWith Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
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());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy