forked from nusCS2113-AY1819S2/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Storage.java
48 lines (41 loc) · 1.34 KB
/
Storage.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
package planmysem.storage;
import planmysem.common.exceptions.IllegalValueException;
import planmysem.model.Planner;
/**
* API of the Logic component
*/
public interface Storage {
/**
* Saves all model to this storage file.
*
* @throws StorageFile.StorageOperationException if there were errors converting and/or storing model to file.
*/
void save(Planner planner) throws StorageFile.StorageOperationException;
/**
* Loads model from this storage file.
*
* @throws StorageFile.StorageOperationException if there were errors reading and/or converting model from file.
*/
Planner load() throws StorageFile.StorageOperationException;
/**
* Gets path of file.
**/
String getPath();
/**
* Signals that the given file path does not fulfill the storage filepath constraints.
*/
class InvalidStorageFilePathException extends IllegalValueException {
public InvalidStorageFilePathException(String message) {
super(message);
}
}
/**
* Signals that some error has occured while trying to convert and read/write model between the application
* and the storage file.
*/
class StorageOperationException extends Exception {
public StorageOperationException(String message) {
super(message);
}
}
}