package org.leumasjaffe.recipe.model; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Stream; import javax.swing.ImageIcon; import lombok.Data; @Data public class Recipe implements CompoundRecipeComponent { String title; String description; int servings; // TODO: Nutrition information Optional photo; // TODO JSONIZATION List products = new ArrayList<>(); @Override public Stream getComponents() { return products.stream(); } @Override public Stream getIngredientsAsStream() { return getComponents().flatMap(Product::getIngredientsAsStream); } }