com.jiuxian.mossrose.ui.vo.JobVoHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mossrose-ui Show documentation
Show all versions of mossrose-ui Show documentation
User Interface for Mossrose
package com.jiuxian.mossrose.ui.vo;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.beanutils.BeanUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jiuxian.mossrose.JobOperation.JobRuntimeInfo;
public final class JobVoHelper {
private static final Logger LOGGER = LoggerFactory.getLogger(JobVoHelper.class);
public static JobVo toVo(JobRuntimeInfo job) {
try {
JobVo vo = new JobVo();
BeanUtils.copyProperties(vo, job);
return vo;
} catch (IllegalAccessException | InvocationTargetException e) {
LOGGER.error(e.getMessage(), e);
}
return null;
}
public static List toVos(List jobs) {
if (jobs != null) {
return jobs.stream().map(JobVoHelper::toVo).collect(Collectors.toList());
}
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy