Syncs the local object with the stored object for atomic writes, overwriting the stored data if the user issued a PUT request Note: This method also resets the changed map to false for every field @param meta The stored object to sync from @param overwrite Whether or not all user muta
(final Annotation note, final boolean overwrite)
| 554 | * replaced by the local object |
| 555 | */ |
| 556 | private void syncNote(final Annotation note, final boolean overwrite) { |
| 557 | if (note.start_time > 0 && (note.start_time < start_time || start_time == 0)) { |
| 558 | start_time = note.start_time; |
| 559 | } |
| 560 | |
| 561 | // handle user-accessible stuff |
| 562 | if (!overwrite && !changed.get("end_time")) { |
| 563 | end_time = note.end_time; |
| 564 | } |
| 565 | if (!overwrite && !changed.get("description")) { |
| 566 | description = note.description; |
| 567 | } |
| 568 | if (!overwrite && !changed.get("notes")) { |
| 569 | notes = note.notes; |
| 570 | } |
| 571 | if (!overwrite && !changed.get("custom")) { |
| 572 | custom = note.custom; |
| 573 | } |
| 574 | |
| 575 | // reset changed flags |
| 576 | initializeChangedMap(); |
| 577 | } |
| 578 | |
| 579 | /** |
| 580 | * Sets or resets the changed map flags |
no test coverage detected