textIO.dispose();
textIO.dispose();
textIO.dispose();
@Override public void accept(TextIO textIO, RunnerData runnerData) { TextTerminal<?> terminal = textIO.getTextTerminal(); String initData = (runnerData == null) ? null : runnerData.getInitData(); AppUtil.printGsonMessage(terminal, initData); String user = textIO.newStringInputReader() .withDefaultValue("admin") .read("Username"); String password = textIO.newStringInputReader() .withMinLength(6) .withInputMasking(true) .read("Password"); int age = textIO.newIntInputReader() .withMinVal(13) .read("Age"); Month month = textIO.newEnumInputReader(Month.class) .read("What month were you born in?"); terminal.printf("\nUser %s is %d years old, was born in %s and has the password %s.\n", user, age, month, password); textIO.newStringInputReader().withMinLength(0).read("\nPress enter to terminate..."); textIO.dispose("User '" + user + "' has left the building."); }
@Override public void accept(TextIO textIO, RunnerData runnerData) { TextTerminal<?> terminal = textIO.getTextTerminal(); String initData = (runnerData == null) ? null : runnerData.getInitData(); AppUtil.printGsonMessage(terminal, initData); terminal.executeWithPropertiesPrefix("custom.title", t -> t.print("Cuboid dimensions: ")); terminal.println(); double length = textIO.newDoubleInputReader() .withMinVal(0.0) .withPropertiesPrefix("custom.length") .read("Length"); double width = textIO.newDoubleInputReader() .withMinVal(0.0) .withPropertiesPrefix("custom.width") .read("Width"); double height = textIO.newDoubleInputReader() .withMinVal(0.0) .withPropertiesPrefix("custom.height") .read("Height"); terminal.executeWithPropertiesPrefix("custom.title", t -> t.print("The volume of your cuboid is: " + length * width * height)); terminal.println(); textIO.newStringInputReader() .withMinLength(0) .withPropertiesPrefix("custom.neutral") .read("\nPress enter to terminate..."); textIO.dispose(); }
textIO.dispose();
textIO.dispose();
textIO.dispose("Payment receipt sent to " + owner + ".");