Class FB<D extends org.cxbox.api.data.dto.DataResponseDTO,S extends FB<D,S>>

java.lang.Object
org.cxbox.core.service.drilldown.filter.FB<D,S>
Type Parameters:
D - DTO type (must extend DataResponseDTO)
S - Self type for fluent chaining

public class FB<D extends org.cxbox.api.data.dto.DataResponseDTO,S extends FB<D,S>> extends Object
Abstract base class FB for building URL-encoded filter strings for business components.
Short class name FB(FilterBuilder) ensures non-intrusive IntelliJ IDEA inline highlights.

Provides a fluent API for adding filters of various types (input, dictionary, date, number, etc.) and assembling them into a single filter string suitable for use in platform requests.

Usage Example


 fb.input(MyDTO_.name, "searchText")
              .number(MyDTO_.id, 123L)
              .dateFromTo(MyDTO_.createdAt, LocalDate.of(2025, 1, 1), LocalDate.of(2025, 1, 31));
 String filterString = filterBuilder.formUrlPart(bcIdentifier);
 
  • Constructor Details

    • FB

      protected FB()
      Constructs the filter builder and injects the filter service.
  • Method Details

    • input

      public S input(@NonNull @NonNull DtoField<? super D,String> field, @Nullable String value)
      Adds a filter for a String input field ("type": "input")

      Note: Use only for fields having "type": "dictionary" in *.widget.json and ? implements Dictionary type in DTO.

      Example usage with default implementation FB:

      
       fb.input(MyDTO_.input, "input");
       

      Parameters:
      field - DTO field
      value - value to filter by (nullable)
      Returns:
      builder FB for fluent api
    • dictionary

      public <T extends Dictionary> S dictionary(@NonNull @NonNull DtoField<? super D,T> field, @Nullable T value)
      Adds a filter for a dictionary field ("type": "dictionary").

      Note: Use only for fields having "type": "dictionary" in *.widget.json and ? implements Dictionary type in DTO.

      Example usage with default implementation FB:

      
       fb.dictionary(MyDTO_.dictionary, MyDictionary.VALUE);
       

      Parameters:
      field - DTO field
      value - dictionary value (nullable)
      Returns:
      this builder FB instance for fluent chaining
    • dictionary

      public <T extends Dictionary> S dictionary(@NonNull @NonNull DtoField<? super D,T> field, @Nullable Collection<T> values)
      Adds a filter for a dictionary field with multiple values.

      Note: Use only for fields having "type": "dictionary" in *.widget.json and ? implements Dictionary type in DTO.

      Example usage with default implementation FB:

      
       fb.dictionary(MyDTO_.dictionary, List.of(MyDictionary.VALUE1,of(MyDictionary.VALUE1));
       

      Parameters:
      field - DTO field
      values - collection of dictionary values (nullable or empty)
      Returns:
      this builder
    • dictionaryEnum

      public <T extends Enum<?>> S dictionaryEnum(@NonNull @NonNull DtoField<? super D,T> field, @Nullable T value)
      Adds a filter for a dictionary field ("type": "dictionary").

      Note: Use only for fields having "type": "dictionary" in *.widget.json and ? extends Enum<?> type in DTO.

      Example usage with default implementation FB:

      
       fb.dictionary(MyDTO_.dictionary, MyDictionary.VALUE);
       

      Parameters:
      field - DTO field
      value - dictionary value (nullable)
      Returns:
      this builder FB instance for fluent chaining
    • dictionaryEnum

      public <T extends Enum<?>> S dictionaryEnum(@NonNull @NonNull DtoField<? super D,T> field, @Nullable Collection<T> values)
      Adds a filter for an enum dictionary field ("type": "dictionary") with multiple values.

      Note: Use only for fields having "type": "dictionary" in *.widget.json and ? extends Enum<?> type in DTO.

      Example usage with default implementation FB:

      
       fb.dictionary(MyDTO_.dictionary, List.of(MyDictionaryEnum.VALUE1,MyDictionaryEnum.VALUE2));
       

      Parameters:
      field - DTO field
      values - collection of dictionary values (nullable or empty)
      Returns:
      this builder FB instance for fluent chaining
    • date

      public S date(@NonNull @NonNull DtoField<? super D,LocalDateTime> field, @Nullable LocalDate value)
      Adds a filter for a date field ("type": "date"), single value.

      Note: Use only for fields having "type": "date" in *.widget.json and LocalDateTime type in DTO.
      Note: Use only if disabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=false

      Example usage:

      
       fb.date(MyDTO_.date, LocalDate.now());
       

      Parameters:
      field - DTO field
      value - date value (nullable)
      Returns:
      this builder
    • dateFromTo

      public S dateFromTo(@NonNull @NonNull DtoField<? super D,LocalDateTime> field, @Nullable LocalDate from, @Nullable LocalDate to)
      Adds a range filter for a date field ("type": "date").

      Note: Use only for fields having "type": "date" in *.widget.json and LocalDateTime type in DTO.
      Note:Use only if enabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=true

      Example usage:

      
       fb.dateFromTo(MyDTO_.date,
           LocalDate.of(2025, 1, 1),
           LocalDate.of(2025, 1, 31))
       

      Parameters:
      field - DTO field
      from - start date (inclusive, nullable)
      to - end date (inclusive, nullable)
      Returns:
      this builder
    • dateTime

      public S dateTime(@NonNull @NonNull DtoField<? super D,LocalDateTime> field, @Nullable LocalDateTime value)
      Adds a filter for a dateTime field ("type": "dateTime"), single value.

      Note: Use only for fields having "type": "dateTime" in *.widget.json and LocalDateTime type in DTO.
      Note:Use only if disabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=false

      Example usage:

      
       fb.dateTime(MyDTO_.dateTime, LocalDate.now());
       

      Parameters:
      field - DTO field
      value - date-time value (nullable)
      Returns:
      this builder
    • dateTimeFromTo

      public S dateTimeFromTo(@NonNull @NonNull DtoField<? super D,LocalDateTime> field, @Nullable LocalDateTime from, @Nullable LocalDateTime to)
      Adds a range filter for a dateTime field ("type": "dateTime").

      Note: Use for fields having "type": "dateTime" in *.widget.json and LocalDateTime type in DTO.
      Note: Use only if enabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=true

      Example usage:

      
       fb.dateFromTo(Entity_.dateTime,
           LocalDate.now().minusYear(1),
           LocalDate.now().plusYear(1))
       
      Parameters:
      field - DTO field
      from - start datetime (inclusive, nullable)
      to - end datetime (inclusive, nullable)
      Returns:
      this builder
    • multiValue

      public S multiValue(@NonNull @NonNull DtoField<? super D,MultivalueField> field, @Nullable MultivalueField value)
      Adds a filter for a multivalue field ("type": "multivalue").

      Note: Use only for fields having "type": "multivalue" in *.widget.json and MultivalueField type in DTO.

      Example usage:

      
       fb.multivalue(MyDTO_.multivalue, myMultivalue);
       

      Parameters:
      field - DTO field
      value - multivalue field (nullable)
      Returns:
      this builder
    • number

      public <T extends Number> S number(@NonNull @NonNull DtoField<? super D,T> field, T value)
      Adds a filter for a number field ("type": "number"), single value.

      Note: Use only for fields having "type": "number" in *.widget.json and ? extends Number type in DTO.
      Note:Use only if disabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=false

      Example usage:

      
       fb.number(MyDTO_.number, 1L);
       

      Parameters:
      field - DTO field
      value - number value (nullable)
      Returns:
      this builder
    • numberFromTo

      public <T extends Number> S numberFromTo(@NonNull @NonNull DtoField<? super D,T> field, @Nullable T from, @Nullable T to)
      Adds a range filter for a number field ("type": "number").

      Note:Use only for fields having "type" : "number" in .widget.json and ? extend Number in DTO
      Note:Use only if enabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=true

      Example usage:
      
       fb.number(MyDTO_.number, 1,10);
       

      Parameters:
      field - DTO field
      from - lower bound (inclusive, nullable)
      to - upper bound (inclusive, nullable)
      Returns:
      this builder
    • percent

      public <T extends Number> S percent(@NonNull @NonNull DtoField<? super D,T> field, T value)
      Adds a filter for a percent field ("type": "percent"), single value.

      Note: Use only for fields having "type": "percent" in *.widget.json and ? extends Number type in DTO.
      Note:Use only if disabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=false

      Example usage:

      
       fb.percent(MyDTO_.percent, 10L);
       

      Parameters:
      field - DTO field
      value - percent value (nullable)
      Returns:
      this builder
    • percentFromTo

      @NonNull public <T extends Number> S percentFromTo(@NonNull @NonNull DtoField<? super D,T> field, T from, T to)
      Adds a range filter for a percent field ("type": "percentFromTo").

      Note:Use only for fields having "type" : "percentFromTo" in .widget.json and ? extend Number in DTO
      Note:Use only if enabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=true

      Example usage:

      
       fb.percentFromTo(MyDTO_.percentFromTo, 5L, 10L);
       

      Parameters:
      field - DTO field
      from - lower bound (inclusive, nullable)
      to - upper bound (inclusive, nullable)
      Returns:
      this builder
    • text

      public S text(@NonNull @NonNull DtoField<? super D,String> field, String value)
      Adds a filter for a text field ("type": "text").

      Note: Use only for fields having "type": "text" in *.widget.json and String type in DTO.

      Example usage:

      
       CxboxFBBase<MyDTO> filterBuilder = new CxboxFBBase<>();
       fb.text(MyDTO_.text, "searchText");
       

      Parameters:
      field - DTO field
      value - text value (nullable)
      Returns:
      this builder
    • radio

      public <T extends Enum<?>> S radio(@NotNull @NotNull DtoField<? super D,T> field, Collection<T> values)
      Adds a filter for a radio field ("type": "radio").

      Note: Use only for fields having "type": "radio" in *.widget.json and ? extends Enum<?> type in DTO.

      Example usage:

      
       fb.radio(MyDTO_.radio, List.of(RadioEnum.VALUE));
       

      Parameters:
      field - DTO field
      values - radio values (nullable or empty)
      Returns:
      this builder
    • checkbox

      public S checkbox(@NotNull @NotNull DtoField<? super D,Boolean> field, Boolean value)
      Adds a filter for a checkbox field ("type": "checkbox").

      Note: Use only for fields having "type": "checkbox" in *.widget.json and Boolean type in DTO.

      Example usage:

      
       fb.checkbox(MyDTO_.checkbox, true);
       

      Parameters:
      field - DTO field
      value - boolean value (nullable)
      Returns:
      this builder
    • money

      public <T extends Number> S money(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for a money field ("type": "money"), single value.

      Note: Use only for fields having "type": "money" in *.widget.json and ? extends Number type in DTO.
      Note:Use only if disabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=false

      Example usage:

      
       fb.money(MyDTO_.money, 10000L);
       

      Parameters:
      field - DTO field
      value - money value (nullable)
      Returns:
      this builder
    • moneyFromTo

      public <T extends Number> S moneyFromTo(@NotNull @NotNull DtoField<? super D,T> field, T from, T to)
      Adds a range filter for a money field ("type": "moneyFromTo").

      Note:Use only for fields having "type" : "moneyFromTo" in .widget.json and ? extend Number in DTO
      Note:Use only if enabled property filter-by-range-enabled-default cxbox.widget.fields.filter-by-range-enabled-default=true

      Example usage:

      
       fb.moneyFromTo(MyDTO_.moneyFromTo, 5000L, 10000L);
       

      Parameters:
      field - DTO field
      from - lower bound (inclusive, nullable)
      to - upper bound (inclusive, nullable)
      Returns:
      this builder
    • fileUpload

      public <T extends Serializable> S fileUpload(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for a file upload field ("type": "fileUpload").

      Note: Use only for fields having "type": "fileUpload" in *.widget.json and ? extends Serializable type in DTO.

      Example usage:

      
       fb.fileUpload(MyDTO_.fileUpload,  "UUID");
       

      Parameters:
      field - DTO field
      value - file value (nullable)
      Returns:
      this builder
    • pickList

      public <T extends Serializable> S pickList(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for a pick list field ("type": "pickList").

      Note: Use only for fields having "type": "pickList" in *.widget.json and ? extends Serializable type in DTO.

      Example usage:

      
       fb.pickList(MyDTO_.pickList,  "pickList");
       

      Parameters:
      field - DTO field
      value - pick list value (nullable)
      Returns:
      this builder
    • inlinePickList

      public <T extends Serializable> S inlinePickList(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for an inline pick list field ("type": "inlinePickList").

      Note: Use only for fields having "type": "inlinePickList" in *.widget.json and ? extends Serializable type in DTO.

      Example usage:

      
       fb.inlinePickList(MyDTO_.inlinePickList,  "inlinePickList");
       

      Parameters:
      field - DTO field
      value - pick list value (nullable)
      Returns:
      this builder
    • multifield

      public <T extends Serializable> S multifield(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for a multifield field ("type": "multifield").

      Note: Use only for fields having "type": "multifield" in *.widget.json and ? extends Serializable type in DTO.

      Example usage:

      
       fb.inlinePickList(MyDTO_.inlinePickList, "inlinePickList");
       

      Parameters:
      field - DTO field
      value - multifield value (nullable)
      Returns:
      this builder
    • suggestionPickList

      public <T extends Serializable> S suggestionPickList(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for a suggestion pick list field ("type": "suggestionPickList").

      Note: Use only for fields having "type": "suggestionPickList" in *.widget.json and ? extends Serializable type in DTO.

      Example usage:

      
       fb.suggestionPickList(MyDTO_.suggestionPickList, "suggestionPickList
       

      Parameters:
      field - DTO field
      value - suggestion value (nullable)
      Returns:
      this builder
    • multivalueHover

      public <T extends MultivalueField> S multivalueHover(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for a multivalue hover field ("type": "multivalueHover").

      Note: Use only for fields having "type": "multivalueHover" in *.widget.json and ? extends MultivalueField type in DTO.

      Example usage:

      
       fb.multivalueHover(MyDTO_.multivalueHover, multivalueHoverValue);
       

      Parameters:
      field - DTO field
      value - multivalue value (nullable)
      Returns:
      this builder
    • multipleSelect

      public <T extends MultivalueField> S multipleSelect(@NotNull @NotNull DtoField<? super D,T> field, T value)
      Adds a filter for a multiple select field ("type": "multipleSelect").

      Note: Use only for fields having "type": "multipleSelect" in *.widget.json and ? extends MultivalueField type in DTO.

      Example usage:

      
       fb.multipleSelect(MyDTO_.multipleSelect, multipleSelectValue);
       

      Parameters:
      field - DTO field
      value - multivalue value (nullable)
      Returns:
      this builder
    • add

      protected S add(String value)
      Adds a filter string to this builder.
      Parameters:
      value - filter string (nullable or empty ignored)
      Returns:
      this builder
    • self

      protected S self()
      Returns this instance as the subclass type for fluent chaining.
      Returns:
      this builder