Class Choices

java.lang.Object
nz.org.riskscape.wizard.survey2.Choices
All Implemented Interfaces:
BackingData

public class Choices extends Object implements BackingData

Backing data for a set of choices. The UI should/can offer these choices to the user when asking this question.

  • Constructor Details

    • Choices

      public Choices(Class<?> parameterType, List<?> choices)
  • Method Details

    • getAll

      public <T> List<T> getAll(Class<T> asType)
      Returns:
      a list of all the choices in this choices option, casting the values to asType - note that asType must be the same or a super type of the BackingData's parameterType
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getParameterType

      public Class<?> getParameterType()
      Specified by:
      getParameterType in interface BackingData
      Returns:
      the class which corresponds to Question.getParameterType() this backing data. Mostly used for assertions and type safety checks in generic code.
    • getChoices

      public List<?> getChoices()