Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ContactList storage #258

Merged
merged 9 commits into from
Oct 20, 2020

Conversation

jonasngs
Copy link
Collaborator

Fixes #241

This PR relates to the implementation of storage functionalities for Contact list.

The following classes were added:

  1. ContactListStorage
  2. JsonAdaptedContact
  3. JsonContactListStorage
  4. JsonSerializableContactList

The following classes were modified:

  1. MainApp: Initialize a contact list using data retrieved from storage and handle cases when the storage file could not be read or the contacts could not be retrieved.
  2. LogicManager: Update the storage of contact lists after the execution of each command.
  3. UserPrefs: Add contact list storage file path.
  4. StorageManager: Add a ContactListStorage field to be managed by StorageManager, and relevant methods relating to ContactList storage reading and writing.

… enable

reading and saving of a contact list to storage.

This prevents the storage of the user's contact list for future
references.

Let's
* Implement the relevant read and save methods in the Storage
  interface and StorageManager class.
* Add a ContactListStorage field in the StorageManager class to manage
  the stored contact list.
@jonasngs jonasngs added type.Task Something that needs to be done, but not a story, bug, or an epic. priority.High Must do type.code A piece of code to be used labels Oct 18, 2020
@jonasngs jonasngs added this to the V1.3 milestone Oct 18, 2020
@jonasngs jonasngs self-assigned this Oct 18, 2020
@codecov-io
Copy link

codecov-io commented Oct 18, 2020

Codecov Report

Merging #258 into master will decrease coverage by 1.52%.
The diff coverage is 7.84%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #258      +/-   ##
============================================
- Coverage     28.49%   26.96%   -1.53%     
+ Complexity      312      308       -4     
============================================
  Files           138      141       +3     
  Lines          2218     2314      +96     
  Branches        249      259      +10     
============================================
- Hits            632      624       -8     
- Misses         1532     1635     +103     
- Partials         54       55       +1     
Impacted Files Coverage Δ Complexity Δ
src/main/java/seedu/address/MainApp.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...rc/main/java/seedu/address/logic/LogicManager.java 0.00% <0.00%> (-35.00%) 0.00 <0.00> (-2.00)
...java/seedu/address/storage/JsonAdaptedContact.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../seedu/address/storage/JsonContactListStorage.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...u/address/storage/JsonSerializableContactList.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ain/java/seedu/address/storage/StorageManager.java 0.00% <0.00%> (-44.45%) 0.00 <0.00> (-4.00)
src/main/java/seedu/address/model/UserPrefs.java 78.94% <72.72%> (+2.28%) 11.00 <2.00> (+2.00)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9349d73...445b814. Read the comment docs.

Copy link
Collaborator

@murtubak murtubak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Code quality and styling fits with the rest of the package

@murtubak
Copy link
Collaborator

Theres a conflict to resolve with the MainApp file before merging, otherwise LGTM.

@jonasngs jonasngs merged commit 406237e into AY2021S1-CS2103T-F12-3:master Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Must do type.code A piece of code to be used type.Task Something that needs to be done, but not a story, bug, or an epic.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contact List: Implement storage functionality for the storing of contacts in a json file
3 participants