-
Notifications
You must be signed in to change notification settings - Fork 548
/
Copy pathJsonAdaptedInteractions.java
46 lines (39 loc) · 1.44 KB
/
JsonAdaptedInteractions.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
package seedu.address.storage;
import java.time.LocalDate;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import seedu.address.model.interaction.Interaction;
/**
* Jackson-friendly version of {@link Interaction}.
*/
class JsonAdaptedInteractions {
public final String description;
public final LocalDate date;
/**
* Constructs a {@code JsonAdaptedInteraction} with the given
* {@code description} and {@code date}.
*/
@JsonCreator
public JsonAdaptedInteractions(@JsonProperty("description") String description,
@JsonProperty("date") LocalDate date) {
this.description = description;
this.date = date;
}
/**
* Converts a given {@code Tag} into this class for Jackson use.
*/
public JsonAdaptedInteractions(Interaction source) {
System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
this.description = source.description;
this.date = source.date;
}
/**
* Converts this Jackson-friendly adapted tag object into the model's {@code Tag} object.
*
* @throws IllegalValueException if there were any data constraints violated in the adapted tag.
*/
public Interaction toModelType() {
System.out.println("INSIDE toModelTYPE@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
return new Interaction(description, date.toString());
}
}