package Main;

import java.util.ArrayList;
import java.util.List;

import Objects.Product;
import Parsers.ElGiganten;
import Parsers.Komplett;
import Parsers.MediaMarkt;
import Parsers.NetOnNet;
import Parsers.Webhallen;

public class ParseUrls {

	List<Product> products = new ArrayList<Product>();

	public ParseUrls(List<Product> urls) {
		products = urls;
	}

	public void run() {

		List<Product> elGigantenProducts = products.stream().filter(p -> p.getStore().equals(StoreParser.EL_GIGANTEN)).toList();
		List<Product> mediaMarktProducts = products.stream().filter(p -> p.getStore().equals(StoreParser.MEDIA_MARKT)).toList();
		List<Product> komplettProducts = products.stream().filter(p -> p.getStore().equals(StoreParser.KOMPLETT)).toList();
		List<Product> webhallenProducts = products.stream().filter(p -> p.getStore().equals(StoreParser.WEBHALLEN)).toList();
		List<Product> netOnNetProducts = products.stream().filter(p -> p.getStore().equals(StoreParser.NET_ON_NET)).toList();

		MediaMarkt mediaMarkt = new MediaMarkt();
		mediaMarktProducts.forEach(mediaMarkt::checkProduct);

		Komplett komplett = new Komplett();
		komplettProducts.forEach(komplett::checkProduct);

		Webhallen webhallen = new Webhallen();
		webhallenProducts.forEach(webhallen::checkProduct);

		NetOnNet netOnNet = new NetOnNet();
		netOnNetProducts.forEach(netOnNet::checkProduct);

		ElGiganten elGiganten = new ElGiganten();
		elGigantenProducts.forEach(elGiganten::checkProduct);
	}

}
