class TextInputDialogBuilder extends AbstractDialogBuilder<TextInputDialogBuilder, TextInputDialog> {
    private String initialContent;
    private TerminalSize textBoxSize;
    private TextInputDialogResultValidator validator;
    private boolean passwordInput;

    /**
     * Default constructor
     */
    public TextInputDialogBuilder() {
        super("TextInputDialog");
        this.initialContent = "";
        this.textBoxSize = null;
        this.validator = null;
        this.passwordInput = false;
    }

    @Override
    protected TextInputDialogBuilder self() {
        return this;
    }

    protected TextInputDialog buildDialog() {
        TerminalSize size = textBoxSize;
        if ((initialContent == null || initialContent.trim().equals("")) && size == null) {
            size = new TerminalSize(40, 1);
        }
        return new TextInputDialog(
                title,
                description,
                size,
                initialContent,
                validator,
                passwordInput);
    }

    /**
     * Sets the initial content the dialog will have
     * @param initialContent Initial content the dialog will have
     * @return Itself
     */
    public TextInputDialogBuilder setInitialContent(String initialContent) {
        this.initialContent = initialContent;
        return this;
    }

    /**
     * Returns the initial content the dialog will have
     * @return Initial content the dialog will have
     */
    public String getInitialContent() {
        return initialContent;
    }

    /**
     * Sets the size of the text box the dialog will have
     * @param textBoxSize Size of the text box the dialog will have
     * @return Itself
     */
    public TextInputDialogBuilder setTextBoxSize(TerminalSize textBoxSize) {
        this.textBoxSize = textBoxSize;
        return this;
    }

    /**
     * Returns the size of the text box the dialog will have
     * @return Size of the text box the dialog will have
     */
    public TerminalSize getTextBoxSize() {
        return textBoxSize;
    }

    /**
     * Sets the validator that will be attached to the text box in the dialog
     * @param validator Validator that will be attached to the text box in the dialog
     * @return Itself
     */
    public TextInputDialogBuilder setValidator(TextInputDialogResultValidator validator) {
        this.validator = validator;
        return this;
    }

    /**
     * Returns the validator that will be attached to the text box in the dialog
     * @return validator that will be attached to the text box in the dialog
     */
    public TextInputDialogResultValidator getValidator() {
        return validator;
    }

    /**
     * Helper method that assigned a validator to the text box the dialog will have which matches the pattern supplied
     * @param pattern Pattern to validate the text box
     * @param errorMessage Error message to show when the pattern doesn't match
     * @return Itself
     */
    public TextInputDialogBuilder setValidationPattern(final Pattern pattern, final String errorMessage) {<FILL_FUNCTION_BODY>}

    /**
     * Sets if the text box the dialog will have contains a password and should be masked (default: {@code false})
     * @param passwordInput {@code true} if the text box should be password masked, {@code false} otherwise
     * @return Itself
     */
    public TextInputDialogBuilder setPasswordInput(boolean passwordInput) {
        this.passwordInput = passwordInput;
        return this;
    }

    /**
     * Returns {@code true} if the text box the dialog will have contains a password and should be masked
     * @return {@code true} if the text box the dialog will have contains a password and should be masked
     */
    public boolean isPasswordInput() {
        return passwordInput;
    }
}

        return setValidator(content -> {
            Matcher matcher = pattern.matcher(content);
            if(!matcher.matches()) {
                if(errorMessage == null) {
                    return "Invalid input";
                }
                return errorMessage;
            }
            return null;
        });
    
<methods>public void <init>(java.lang.String) ,public final com.googlecode.lanterna.gui2.dialogs.TextInputDialog build() ,public java.lang.String getDescription() ,public Set<com.googlecode.lanterna.gui2.Window.Hint> getExtraWindowHints() ,public java.lang.String getTitle() ,public com.googlecode.lanterna.gui2.dialogs.TextInputDialogBuilder setDescription(java.lang.String) ,public com.googlecode.lanterna.gui2.dialogs.TextInputDialogBuilder setExtraWindowHints(Set<com.googlecode.lanterna.gui2.Window.Hint>) ,public com.googlecode.lanterna.gui2.dialogs.TextInputDialogBuilder setTitle(java.lang.String) <variables>protected java.lang.String description,protected Set<com.googlecode.lanterna.gui2.Window.Hint> extraWindowHints,protected java.lang.String title