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

Refactor the ReadOnly interfaces #154

Merged

Conversation

w-yeehong
Copy link
Collaborator

There are currently three interfaces that serve a similar purpose: ReadOnlyPatientRecords, ReadOnlyRoomList, and ReadOnlyTaskList.

We can refactor these interfaces into one using generics ReadOnlyList<T> to avoid code duplication.

Other changes:

  • Add authorship tags
  • Move UniqueRoomList to the room package

@w-yeehong w-yeehong changed the title Refactor readonlylist Refactor the ReadOnly interfaces Oct 27, 2020
There are three interfaces that serve a similar purpose:
ReadOnlyPatientRecords, ReadOnlyRoomList, and ReadOnlyTaskList.

This results in code duplication.

Let's refactor these interfaces into one using generics: ReadOnlyList<T>,
where T can be PatientRecords, RoomList, or TaskList.
Copy link

@chiamyunqing chiamyunqing left a comment

Choose a reason for hiding this comment

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

LGTM! Good learning point for using Java Generics, definitely makes it neater!

@w-yeehong w-yeehong added this to the v1.3 milestone Oct 28, 2020
@codecov-io
Copy link

Codecov Report

Merging #154 into master will not change coverage.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #154   +/-   ##
=========================================
  Coverage     67.42%   67.42%           
  Complexity      752      752           
=========================================
  Files           117      117           
  Lines          2646     2646           
  Branches        328      328           
=========================================
  Hits           1784     1784           
  Misses          743      743           
  Partials        119      119           
Impacted Files Coverage Δ Complexity Δ
src/main/java/seedu/address/MainApp.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
.../java/seedu/address/commons/util/DateTimeUtil.java 96.42% <ø> (ø) 4.00 <0.00> (ø)
...rc/main/java/seedu/address/logic/LogicManager.java 61.29% <ø> (ø) 3.00 <0.00> (ø)
...du/address/logic/commands/task/AddTaskCommand.java 38.09% <ø> (ø) 8.00 <0.00> (ø)
...address/logic/commands/task/DeleteTaskCommand.java 32.00% <ø> (ø) 7.00 <0.00> (ø)
...u/address/logic/commands/task/EditTaskCommand.java 46.00% <ø> (ø) 8.00 <0.00> (ø)
...ddress/logic/parser/task/AddTaskCommandParser.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
...ess/logic/parser/task/DeleteTaskCommandParser.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
...dress/logic/parser/task/EditTaskCommandParser.java 90.00% <ø> (ø) 7.00 <0.00> (ø)
src/main/java/seedu/address/model/Model.java 100.00% <ø> (ø) 3.00 <0.00> (ø)
... and 16 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 89ca9c2...ada0cdf. Read the comment docs.

@w-yeehong w-yeehong merged commit 6e14e07 into AY2021S1-CS2103T-W12-1:master Oct 28, 2020
@w-yeehong w-yeehong added Priority.Low Type.CodeQuality Improvements to code quality labels Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority.Low Type.CodeQuality Improvements to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants