step.planbuilder.FunctionPlanBuilder Maven / Gradle / Ivy
package step.planbuilder;
import javax.json.Json;
import javax.json.JsonObjectBuilder;
import step.artefacts.CallFunction;
import step.artefacts.FunctionGroup;
import step.core.dynamicbeans.DynamicValue;
public class FunctionPlanBuilder {
public static FunctionGroup session() {
FunctionGroup call = new FunctionGroup();
return call;
}
public static CallFunction keywordWithDynamicInput(String keywordName, String input) {
CallFunction call = new CallFunction();
call.setArgument(new DynamicValue(input,""));
call.getFunction().setValue("{\"name\":\""+keywordName+"\"}");
return call;
}
public static CallFunction keywordWithKeyValues(String keywordName, String... keyValues) {
CallFunction call = new CallFunction();
JsonObjectBuilder builder = Json.createObjectBuilder();
if(keyValues!=null) {
for(int i=0;i(builder.build().toString()));
call.getFunction().setValue("{\"name\":\""+keywordName+"\"}");
return call;
}
public static CallFunction keywordWithDynamicKeyValues(String keywordName, String... keyValues) {
CallFunction call = new CallFunction();
JsonObjectBuilder builder = Json.createObjectBuilder();
if(keyValues!=null) {
for(int i=0;i(builder.build().toString()));
call.getFunction().setValue("{\"name\":\""+keywordName+"\"}");
return call;
}
public static CallFunction keyword(String keywordName, String input) {
CallFunction call = new CallFunction();
call.setArgument(new DynamicValue(input));
call.getFunction().setValue("{\"name\":\""+keywordName+"\"}");
return call;
}
public static CallFunction keywordById(String keywordId, String input) {
CallFunction call = new CallFunction();
call.setArgument(new DynamicValue(input));
call.setFunctionId(keywordId);
return call;
}
public static CallFunction keyword(String keywordName) {
return keyword(keywordName, "{}");
}
}