Interface EnumParameter

    • Method Detail

      • 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
        java.lang.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
        java.lang.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