forked from mrigor87/CalorieManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMealRepository.java
More file actions
31 lines (23 loc) · 767 Bytes
/
MealRepository.java
File metadata and controls
31 lines (23 loc) · 767 Bytes
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
package ru.javawebinar.topjava.repository;
import ru.javawebinar.topjava.model.Meal;
import java.time.LocalDateTime;
import java.util.Collection;
/**
* GKislin
* 06.03.2015.
*/
public interface MealRepository {
// null if updated meal do not belong to userId
Meal save(Meal meal, int userId);
// false if meal do not belong to userId
boolean delete(int id, int userId);
// null if meal do not belong to userId
Meal get(int id, int userId);
// ORDERED dateTime
Collection<Meal> getAll(int userId);
// ORDERED dateTime
Collection<Meal> getBetween(LocalDateTime startDate, LocalDateTime endDate, int userId);
default Meal getWithUser(int id, int userId) {
throw new UnsupportedOperationException();
}
}