Prompt Interface
(see PromptFactoryExample.java)
An alternative would be to create an interface, write the prompts there, and then pass this interface using the @Factory annotation:
public interface Wiz {
@Prompt("Enter Name")
String getName();
}
@Entrypoint
public void run(@Factory final Wiz wiz) {
for (int i = 0; i < 5; i++) {
System.out.println("Name " + (i + 1) + ": " + wiz.getName());
}
}
Last update:
2022-03-15