de.ppi.deepsampler.persistence.bean.ext.StandardBeanFactoryExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deepsampler-persistence Show documentation
Show all versions of deepsampler-persistence Show documentation
This module is the core of the persistence api in DeepSampler.
/*
* Copyright 2020 PPI AG (Hamburg, Germany)
* This program is made available under the terms of the MIT License.
*/
package de.ppi.deepsampler.persistence.bean.ext;
import de.ppi.deepsampler.persistence.model.PersistentBean;
import de.ppi.deepsampler.persistence.bean.PersistentBeanFactory;
public abstract class StandardBeanFactoryExtension implements BeanFactoryExtension {
@Override
public boolean skip(Class> beanCls) {
return false;
}
@Override
public PersistentBean toBean(Object bean) {
return new PersistentBeanFactory().toBean(bean);
}
@Override
public T ofBean(PersistentBean bean, Class cls) {
return new PersistentBeanFactory().createValueFromPersistentBean(bean, cls);
}
}