Class DefaultPrompt

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String message  
      protected java.lang.String name  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DefaultPrompt​(java.lang.String name, java.lang.String message)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.function.Function<java.lang.String,​java.lang.String> getFilter()
      Get the filter function that modifies the actual returned value.
      java.lang.String getMessage()
      Get the message to display to the user.
      java.lang.String getName()
      Get the name of this prompt.
      java.util.function.Function<java.lang.String,​java.lang.String> getTransformer()
      Get the transformer function that modifies how the answer is displayed after submission.
      void setFilter​(java.util.function.Function<java.lang.String,​java.lang.String> filter)  
      void setTransformer​(java.util.function.Function<java.lang.String,​java.lang.String> transformer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        protected final java.lang.String name
      • message

        protected final java.lang.String message
    • Constructor Detail

      • DefaultPrompt

        protected DefaultPrompt​(java.lang.String name,
                                java.lang.String message)
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Prompt
        Get the name of this prompt. The name is used as the key in the result map.
        Specified by:
        getName in interface Prompt
        Returns:
        the name of this prompt
      • getMessage

        public java.lang.String getMessage()
        Description copied from interface: Prompt
        Get the message to display to the user.
        Specified by:
        getMessage in interface Prompt
        Returns:
        the message
      • getTransformer

        public java.util.function.Function<java.lang.String,​java.lang.String> getTransformer()
        Description copied from interface: Prompt
        Get the transformer function that modifies how the answer is displayed after submission. This does not change the actual returned value. For example, a password prompt might transform the answer to "***".
        Specified by:
        getTransformer in interface Prompt
        Returns:
        the transformer function, or null for default display
      • getFilter

        public java.util.function.Function<java.lang.String,​java.lang.String> getFilter()
        Description copied from interface: Prompt
        Get the filter function that modifies the actual returned value. This changes the value stored in the result map. For example, trimming whitespace or converting to lowercase.
        Specified by:
        getFilter in interface Prompt
        Returns:
        the filter function, or null for no filtering
      • setTransformer

        public void setTransformer​(java.util.function.Function<java.lang.String,​java.lang.String> transformer)
      • setFilter

        public void setFilter​(java.util.function.Function<java.lang.String,​java.lang.String> filter)