Class Resolution


  • public class Resolution
    extends Object
    A resolution of choices within a template.
    Author:
    bratseth
    • Constructor Detail

      • Resolution

        public Resolution()
    • Method Detail

      • addChoiceResolution

        public void addChoiceResolution​(Choice choice,
                                        int alternativeIndex)
      • getResolution

        public int getResolution​(Choice choice)
        Returns the resolution of a choice.
        Returns:
        the (0-base) index of the choice made. If the given choice has exactly one alternative, 0 is always returned (whether or not the choice has been attempted resolved).
        Throws:
        IllegalArgumentException - if the choice is empty, or if it has multiple alternatives but have not been resolved in this
      • getResolution

        public Map<String,​List<PageElement>> getResolution​(MapChoice choice)
        Returns the resolution of a map choice.
        Returns:
        the chosen mapping - entries from placeholder id to the values to use at the location of that placeholder
        Throws:
        IllegalArgumentException - if this choice has not been resolved in this