Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106-v23-03
backend
Commits
85d09a60
Commit
85d09a60
authored
2 years ago
by
Stian Lyng
Browse files
Options
Downloads
Patches
Plain Diff
add repository
parent
7b9e0fa6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ntnu/idatt2016/v233/SmartMat/repository/RecipeRepository.java
+52
-0
52 additions, 0 deletions
.../idatt2016/v233/SmartMat/repository/RecipeRepository.java
with
52 additions
and
0 deletions
src/main/java/ntnu/idatt2016/v233/SmartMat/repository/RecipeRepository.java
0 → 100644
+
52
−
0
View file @
85d09a60
package
ntnu.idatt2016.v233.SmartMat.repository
;
import
java.util.List
;
import
java.util.Optional
;
import
ntnu.idatt2016.v233.SmartMat.model.Recipe
;
/**
* This interface defines the methods for the recipe repository
*
* @author Stian Lyng
* @version 1.0
*/
public
interface
RecipeRepository
{
/**
* Saves a recipe to the database
*
* @param recipe the recipe to save
*/
Recipe
save
(
Recipe
recipe
);
/**
* Gets a recipe by its ID
*
* @param id the ID of the recipe
* @return an optional containing the recipe if it exists
*/
Optional
<
Recipe
>
getById
(
long
id
);
/**
* Gets a recipe by its name
* @param name the name of the recipe
* @return an optional containing the recipe if it exists
*/
Optional
<
Recipe
>
getByName
(
String
name
);
/**
* Gets all recipes
*
* @return an optional containing a list of all recipes
*/
Optional
<
List
<
Recipe
>>
getAll
();
/**
* Deletes a recipe by its ID
*
* @param id the ID of the recipe
*/
void
deleteById
(
int
id
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment