-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCookbookAccess.java
85 lines (73 loc) · 1.97 KB
/
CookbookAccess.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package cookbook.accessdata;
import cookbook.core.Cookbook;
import cookbook.core.Recipe;
/**
* Interface for accessing a json cookbook.
* using remote or local access.
*/
public interface CookbookAccess {
/**
* Fetches the entire cookbook.
*
* @return the cookbook, or null if the file is not found.
*/
public Cookbook fetchCookbook();
/**
* Searches for recipes by name.
*
* @param recipeName the name or part of the name to search for.
* @return a cookbook containing the matching recipes.
*/
public Cookbook searchRecipe(String recipeName);
/**
* Filters recipes by their origin country.
*
* @param origin the country of origin to filter by.
* @return a cookbook containing the matching recipes.
*/
public Cookbook filterByOrigin(String origin);
/**
* Filters recipes by their type.
*
* @param type the type to filter by.
* @return a cookbook containing the matching recipes.
*/
public Cookbook filterByType(String type);
/**
* Filters recipes that are marked as favorite.
*
* @return a cookbook containing the favorite recipes.
*/
public Cookbook filterByFavorite();
/**
* Filters recipes based on user preferences.
*
* @param vlg a string representing user preferences (vegan, lactose-free, gluten-free)
* @return a cookbook containing the matching recipes.
*/
public Cookbook filterByPreferences(String vlg);
/**
* Updates a recipe in the cookbook.
*
* @param recipe the recipe to update.
*/
public void updateRecipe(Recipe recipe);
/**
* Removes a recipe from the cookbook.
*
* @param recipeName the name of the recipe to remove.
*/
public boolean removeRecipe(String recipeName);
/**
* Adds a new recipe to the cookbook.
*
* @param recipe the recipe to add.
*/
public void addRecipe(Recipe recipe);
/**
* Marks a recipe as favorite.
*
* @param recipe the recipe to mark.
*/
public void toggleFavorite(Recipe recipe);
}