package ru.yandex.webmaster3.core.semantic.data_reactor_common.impl.processors;

import ru.yandex.webmaster3.core.semantic.data_reactor_common.Entity;
import ru.yandex.webmaster3.core.semantic.data_reactor_common.EntityConsumer;
import ru.yandex.webmaster3.core.semantic.data_reactor_common.EntityProcessor;

import java.util.Collection;
import java.util.Collections;

/**
 * Created by IntelliJ IDEA.
 * User: rasifiel
 * Date: 12.12.13
 * Time: 13:34
 */
public class ConsumerEntityProcessor extends EntityProcessor {

    private final EntityConsumer entityConsumer;

    public ConsumerEntityProcessor(final EntityConsumer entityConsumer) {
        this.entityConsumer = entityConsumer;
    }

    @Override
    public Collection<Entity> process(final Entity e) {
        entityConsumer.consume(e);
        return Collections.EMPTY_LIST;
    }
}
