Search in sources :

Example 1 with IBeanDtoFilter

use of org.jowidgets.cap.common.api.filter.IBeanDtoFilter in project jo-client-platform by jo-source.

the class BeanDtoCollectionFilterImpl method filter.

@Override
public ArrayList<IBeanDto> filter(final Collection<? extends IBeanDto> beanDtos, final IFilter filter, final IExecutionCallback executionCallback) {
    final IBeanDtoFilter beanDtoFilter = CapCommonToolkit.beanDtoFilter();
    final ArrayList<IBeanDto> result = new ArrayList<IBeanDto>();
    for (final IBeanDto beanDto : beanDtos) {
        CapServiceToolkit.checkCanceled(executionCallback);
        if (beanDtoFilter.accept(beanDto, filter)) {
            result.add(beanDto);
        }
    }
    return result;
}
Also used : IBeanDto(org.jowidgets.cap.common.api.bean.IBeanDto) IBeanDtoFilter(org.jowidgets.cap.common.api.filter.IBeanDtoFilter) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 IBeanDto (org.jowidgets.cap.common.api.bean.IBeanDto)1 IBeanDtoFilter (org.jowidgets.cap.common.api.filter.IBeanDtoFilter)1