Interface EnumParameter

All Superinterfaces:
ParameterUsableInQuery, RichPageParameter

public interface EnumParameter extends RichPageParameter, ParameterUsableInQuery
Since:
3.9.0
Author:
Jakub Stroleny, Polarion Software
  • Method Details

    • values

      @NotNull StrictList<EnumOption> values()
      Return values. Can be empty.
      Returns:
      list with values.
    • singleValue

      @Nullable EnumOption singleValue()
      Returns first selected value or null if nothing is selected.
    • toLucene

      @NotNull String toLucene()
      Returns the value formated in such way that it can be used in Lucene query

      This method is called automatically when the parameter is used in the Lucene + Velocity in data set parameter, so you can use it like this: severity:$pageParameters.myEnumParameter

      If the value contains spaces it is surrounded by double quotes (")

      For enumeration parameter it returns the list with ids of the selected options escaped same way as value of string parameter (see above) in brackets.

      For empty or not specified parameter it returns "*" which works only for Polarion built in fields, so for custom fields it must be handled in different way. See how the "Query Bubbles" handle this situation in the Polarion UI.

      Specified by:
      toLucene in interface ParameterUsableInQuery
    • toSql

      @NotNull String toSql()
      Returns the value formated in such way that it can be used in SQL query

      This method is called automatically when the parameter is used in the SQL + Velocity in data set parameter, so you can use it like this: ... WHERE ... IN $pageParameters.myEnumParameter

      Enumeration parameter expects using IN (not '=') construction for defining conditions.

      For empty or not specified parameter it returns empty string in brackets

      Specified by:
      toSql in interface ParameterUsableInQuery
    • set

      @NotNull EnumParameter.Setter set()
      Returns:
      interface for setting parameter configuration which can be used inside RichPageWidget.processParameterDependencies(RichPageWidgetDependenciesContext) to change parameter configuration depending on values set by user in other parameters.
      Throws:
      UnsupportedOperationException - if this parameter is a page parameter.
      Since:
      3.9.2
    • enumerationReference

      @NotNull EnumerationReference enumerationReference()
      Since:
      3.22.2
    • allowMultipleValues

      boolean allowMultipleValues()
      Returns true if multiple values allowed.
      Since:
      3.22.2