Class AbstractMultiChoicesHelper

java.lang.Object
org.sklsft.generator.bash.arguments.AbstractMultiChoicesHelper
All Implemented Interfaces:
ChoicesHelper
Direct Known Subclasses:
DatabaseEngineChoicesHelper, SkeletonChoicesHelper, TrueFalseChoicesHelper

public abstract class AbstractMultiChoicesHelper extends Object implements ChoicesHelper
An abstract implementation of ChoicesHelper based on a map of choices
We have to override initialization to fetch the possible values
Be careful that the access to choices is not thread-safe.
We do not consider multi-threading
Author:
Nicolas Thibault
  • Field Details

  • Constructor Details

    • AbstractMultiChoicesHelper

      public AbstractMultiChoicesHelper()
  • Method Details

    • initialize

      protected abstract void initialize()
    • getChoices

      public SortedMap<String,String> getChoices()
    • 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:
    • getChoicesDisplaying

      public String getChoicesDisplaying()
    • getQuestion

      protected abstract String getQuestion()
    • getFullMessage

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