com.swingfrog.summer.ecs.component.AbstractAllBeanComponent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of summer Show documentation
Show all versions of summer Show documentation
a lightweight game server framework
package com.swingfrog.summer.ecs.component;
import com.swingfrog.summer.ecs.entity.Entity;
import java.util.List;
public abstract class AbstractAllBeanComponent>
extends AbstractBeanBaseComponent implements AllBeanComponent {
public AbstractAllBeanComponent(E entity) {
super(entity);
}
@Override
public List listBean() {
return repository.list();
}
@Override
public void addBean(B bean) {
repository.add(bean);
}
@Override
public void removeBean(B bean) {
repository.remove(bean);
}
@Override
public void removeBeanId(K beanId) {
repository.removeByPrimaryKey(beanId);
}
@Override
public void removeAllBean() {
listBean().forEach(repository::remove);
}
@Override
public void saveBean(B bean) {
repository.save(bean);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy