All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.swingfrog.summer.ecs.component.AbstractAllBeanComponent Maven / Gradle / Ivy

There is a newer version: 1.1.18
Show newest version
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