Class Choices

java.lang.Object
nz.org.riskscape.wizard.survey2.Choices

public class Choices extends Object

Helper for generating suitable Choices for wizard questions.

  • Constructor Details

    • Choices

      public Choices()
  • Method Details

    • forEnums

      public static List<Choice> forEnums(List<? extends Enum<?>> enums)
      Returns:
      choices the given enum entries. Useful when you want to only present a subset of the enum values to the user
    • forEnum

      public static List<Choice> forEnum(Class<? extends Enum<?>> enumClass)
      Returns:
      choices for all the entries in the given enum
    • from

      public static List<Choice> from(Question question, IncrementalBuildState buildState)
      Returns:
      choices that are suitable based on the given parameter type
    • forBookmarks

      public static List<Choice> forBookmarks(IncrementalBuildState buildState)
      Returns:
      choices for all the avilable bookmarks in the project
    • forFunctions

      public static List<Choice> forFunctions(IncrementalBuildState buildState, Collection<nz.org.riskscape.engine.function.IdentifiedFunction.Category> matchCategories)
      Returns:
      choices for any functions in the project that match the given categories
    • forScope

      public static List<Choice> forScope(IncrementalBuildState buildState, Question q)
      Returns:
      Choices representing the attributes in scope for the current question
    • forScope

      public static List<Choice> forScope(nz.org.riskscape.engine.types.Struct input, Question q)
      Returns:
      Choices representing the attributes in scope for the given struct. This can be useful for getting a subset of attributes, e.g. just the hazard struct
    • percentiles

      public static List<Choice> percentiles(nz.org.riskscape.engine.Project project)
    • forAggregation

      public static List<Choice> forAggregation(IncrementalBuildState buildState)

      Returns a list of choices of aggregation functions for the wizard. Does not include non-maths functions or a few functions considered too complicated for wizard users.

    • forAggregationNonInteractive

      public static List<Choice> forAggregationNonInteractive(IncrementalBuildState buildState)

      Returns a list of choices of aggregation functions for the wizard. Does not include non-maths functions or a few functions considered too complicated for wizard users.

      This non-interactive version replaces the multi-argument percentile function with a few hard-coded percentile choices.

    • forIdentified

      public static List<Choice> forIdentified(Question question, IncrementalBuildState buildState)