diff --git a/client/src/main/java/client/utils/PrintExportService.java b/client/src/main/java/client/utils/PrintExportService.java index cd226fe..5198c41 100644 --- a/client/src/main/java/client/utils/PrintExportService.java +++ b/client/src/main/java/client/utils/PrintExportService.java @@ -1,4 +1,67 @@ package client.utils; +import commons.Recipe; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + public class PrintExportService { + + /** + * Builds the String with all the recipe data in a human-readable format and returns said string + * @param recipe - Recipe Object that needs to be converted + * @return - String Result that is the converted recipe object + */ + public static String buildRecipeText(Recipe recipe){ + String result = "Title: " + recipe.getName() + "\nRecipe ID: " + recipe.getId() + "\n" + + "Ingredients: "; //Starts the string with name and recipe ID + for(int i =0; i