Search in sources :

Example 1 with IBeanDtoFactory

use of org.jowidgets.cap.service.api.bean.IBeanDtoFactory in project jo-client-platform by jo-source.

the class BeanDtoFactoryHelper method createDtos.

@SuppressWarnings({ "unchecked", "rawtypes" })
public static <BEAN_TYPE> List<IBeanDto> createDtos(final IBeanDtoFactory<? extends BEAN_TYPE> beanDtoFactory, final Collection<? extends BEAN_TYPE> beans, final IExecutionCallback executionCallback) {
    Assert.paramNotNull(beanDtoFactory, "beanDtoFactory");
    Assert.paramNotNull(beans, "beans");
    final List<IBeanDto> result = new LinkedList<IBeanDto>();
    for (final BEAN_TYPE bean : beans) {
        checkCanceled(executionCallback);
        final IBeanDtoFactory factory = beanDtoFactory;
        result.add(factory.createDto(bean));
    }
    return result;
}
Also used : IBeanDto(org.jowidgets.cap.common.api.bean.IBeanDto) IBeanDtoFactory(org.jowidgets.cap.service.api.bean.IBeanDtoFactory) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 IBeanDto (org.jowidgets.cap.common.api.bean.IBeanDto)1 IBeanDtoFactory (org.jowidgets.cap.service.api.bean.IBeanDtoFactory)1