package ru.yandex.qe.dispenser.domain.dao.service.resource.preset;

import java.util.List;
import java.util.stream.Collectors;

import ru.yandex.qe.dispenser.domain.CampaignServiceResourcesPreset;
import ru.yandex.qe.dispenser.domain.dao.InMemoryKeyDaoImpl;

public class CampaignServiceResourcesPresetDaoImpl extends InMemoryKeyDaoImpl<CampaignServiceResourcesPreset, CampaignServiceResourcesPreset.Key> implements CampaignServiceResourcesPresetDao {

    @Override
    public List<CampaignServiceResourcesPreset> getPresetsByCampaignId(final long campaignId) {
        return filter(p -> p.getCampaignId() == campaignId)
                .collect(Collectors.toList());
    }
}
