Class BasicFreeChoicesHelper

java.lang.Object
org.sklsft.generator.bash.arguments.BasicFreeChoicesHelper
All Implemented Interfaces:
ChoicesHelper

public class BasicFreeChoicesHelper extends Object implements ChoicesHelper
An abstract implementation of ChoicesHelper based on a free entry with possible check and conversion
Author:
Nicolas Thibault
  • Constructor Details

    • BasicFreeChoicesHelper

      public BasicFreeChoicesHelper(String question)
  • Method Details

    • getQuestion

      public String getQuestion()
    • getFullMessage

      public String getFullMessage()
      Specified by:
      getFullMessage in interface ChoicesHelper
    • getChoice

      public String getChoice(String key)
      Description copied from interface: ChoicesHelper
      Every implementation should consider that invalid choices lead to null values that will be simply handled in a while condition
      Specified by:
      getChoice in interface ChoicesHelper
      Parameters:
      key -
      Returns:
    • convertKey

      protected String convertKey(String key)
      can be overridden to convert input
      Parameters:
      key -
      Returns:
    • isValid

      protected boolean isValid(String key)
      can be overridden to validate input
      Parameters:
      key -
      Returns: