java.lang.Object
org.cxbox.core.service.drilldown.filter.FC

public class FC extends Object
FC is a builder and container for filter configurations associated with business components (BC).
Short class FC (Filter configuration) name ensures non-intrusive IntelliJ IDEA inline highlights.

It allows adding filter builders for specific DTO classes and BC identifiers, supporting default and custom filter builder types.

 
 FC fc = new FC();
 fc.add(bcIdentifier1, bcIdentifier1DTO.class, fb ->
 	fb.input(bcIdentifier1DTO_.input, "value")
 	// and other needed filed
 )
 .add(bcIdentifier2, BcIdentifier2DTO.class,
  new TypeToken<MyFilterBuilder<BcIdentifier2DTO>>() {},
  fb -> fb
     .customField(bcIdentifier2DTO_.customField, value)
     .input(bcIdentifier2DTO_.input, "value")
 );
 
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Record representing a filter configuration for a specific business component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FC()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <D extends org.cxbox.api.data.dto.DataResponseDTO, F extends FB<D, F>>
    FC
    add(org.cxbox.api.data.BcIdentifier bc, Class<D> dtoClass, com.fasterxml.jackson.core.type.TypeReference<F> token, Consumer<F> filterBuilder)
    Adds a custom filter builder for the specified BC identifier and DTO class using a type token.
    <D extends org.cxbox.api.data.dto.DataResponseDTO>
    FC
    add(org.cxbox.api.data.BcIdentifier bc, Class<D> dtoClass, Consumer<FB<D,?>> consumer)
    Adds a default filter builder for the specified BC identifier and DTO class.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FC

      public FC()
  • Method Details

    • add

      public <D extends org.cxbox.api.data.dto.DataResponseDTO> FC add(org.cxbox.api.data.BcIdentifier bc, Class<D> dtoClass, Consumer<FB<D,?>> consumer)
      Adds a default filter builder for the specified BC identifier and DTO class.
       
       FC fc = new FC();
       fc.add(bcIdentifier1, MyDto1.class, fb -> {
           // configure builder
       })
       
        * 
      Type Parameters:
      D - the type of the DTO DataResponseDTO
      Parameters:
      bc - the business component identifier BcIdentifier
      dtoClass - the DTO class associated with the filter DataResponseDTO
      consumer - a consumer for configuring the filter builder FB<D extends org.cxbox.api.data.dto.DataResponseDTO,?>
      Returns:
      this FC instance for chaining
    • add

      public <D extends org.cxbox.api.data.dto.DataResponseDTO, F extends FB<D, F>> FC add(org.cxbox.api.data.BcIdentifier bc, Class<D> dtoClass, com.fasterxml.jackson.core.type.TypeReference<F> token, Consumer<F> filterBuilder)
      Adds a custom filter builder for the specified BC identifier and DTO class using a type token.
       
       FC fc = new FC();
       fc.add(myBc, MyDto.class,  new TypeToken<MyFilterBuilder<MyDto>>() {} , fb -> {
           // configure builder
       }
       
       
      Type Parameters:
      D - the type of the DTO DataResponseDTO
      F - the type of the filter builder FB
      Parameters:
      bc - the business component identifier BcIdentifier
      dtoClass - the DTO class associated with the filter DataResponseDTO
      token - the type token for the custom filter builder TypeReference
      filterBuilder - a consumer for configuring the custom filter builder FB
      Returns:
      this FC instance for chaining