Search in sources :

Example 1 with Builder

use of de.metas.ui.web.document.filter.DocumentFilter.Builder in project metasfresh-webui-api by metasfresh.

the class SqlViewFactory method createAutoFilter.

private static DocumentFilter createAutoFilter(final DocumentFilterDescriptor filterDescriptor) {
    if (!filterDescriptor.isAutoFilter()) {
        throw new AdempiereException("Not an auto filter: " + filterDescriptor);
    }
    final Builder filterBuilder = DocumentFilter.builder().setFilterId(filterDescriptor.getFilterId());
    filterDescriptor.getParameters().stream().filter(DocumentFilterParamDescriptor::isAutoFilter).map(SqlViewFactory::createAutoFilterParam).forEach(filterBuilder::addParameter);
    return filterBuilder.build();
}
Also used : AdempiereException(org.adempiere.exceptions.AdempiereException) Builder(de.metas.ui.web.document.filter.DocumentFilter.Builder) DocumentFilterParamDescriptor(de.metas.ui.web.document.filter.DocumentFilterParamDescriptor)

Aggregations

Builder (de.metas.ui.web.document.filter.DocumentFilter.Builder)1 DocumentFilterParamDescriptor (de.metas.ui.web.document.filter.DocumentFilterParamDescriptor)1 AdempiereException (org.adempiere.exceptions.AdempiereException)1