Produced by Araxis Merge on 4/27/2018 2:59:09 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | v2.0_Sprint_15_Build_5.zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\dao | CustomerDAO.java | Tue Apr 24 14:49:51 2018 UTC |
| 2 | v2.0_Sprint_15_Build_5..zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\dao | CustomerDAO.java | Thu Apr 26 15:53:41 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 218 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.med.a rs.dao; | |
| 2 | ||
| 3 | import jav a.util.Arr ayList; | |
| 4 | import jav a.util.Lis t; | |
| 5 | ||
| 6 | import org .springfra mework.ste reotype.Co mponent; | |
| 7 | ||
| 8 | import gov .va.med.ar s.model.Cu stomer; | |
| 9 | /** | |
| 10 | * | |
| 11 | * @author PI I
|
|
| 12 | * | |
| 13 | */ | |
| 14 | @Component | |
| 15 | public cla ss Custome rDAO { | |
| 16 | ||
| 17 | // Dummy dat abase. Ini tialize wi th some du mmy values . | |
| 18 | pr ivate stat ic List<Cu stomer> cu stomers; | |
| 19 | { | |
| 20 | cust omers = ne w ArrayLis t<Customer >(); | |
| 21 | cust omers.add( new Custom er(101, "J ohn", "Doe ", "djohn@ gmail.com" , "121-232 -3435")); | |
| 22 | cust omers.add( new Custom er(201, "R uss", "Smi th", "srus s@gmail.co m", "343-5 45-2345")) ; | |
| 23 | cust omers.add( new Custom er(301, "K ate", "Wil liams", "k williams@g mail.com", "876-237- 2987")); | |
| 24 | cust omers.add( new Custom er(System. currentTim eMillis(), "Viral", "Patel", " vpatel@gma il.com", " 356-758-87 36")); | |
| 25 | } | |
| 26 | ||
| 27 | /* * | |
| 28 | * Returns l ist of cus tomers fro m dummy da tabase. | |
| 29 | * | |
| 30 | * @return l ist of cus tomers | |
| 31 | * / | |
| 32 | pu blic List< Customer> list() { | |
| 33 | retu rn custome rs; | |
| 34 | } | |
| 35 | ||
| 36 | /* * | |
| 37 | * Return cu stomer obj ect for gi ven id fro m dummy da tabase. If customer is | |
| 38 | * not found for id, r eturns nul l. | |
| 39 | * | |
| 40 | * @param id | |
| 41 | * customer id | |
| 42 | * @return c ustomer ob ject for g iven id | |
| 43 | * / | |
| 44 | pu blic Custo mer get(Lo ng id) { | |
| 45 | ||
| 46 | for (Customer c : custom ers) { | |
| 47 | if (c. getId().eq uals(id)) { | |
| 48 | return c ; | |
| 49 | } | |
| 50 | } | |
| 51 | retu rn null; | |
| 52 | } | |
| 53 | ||
| 54 | /* * | |
| 55 | * Create ne w customer in dummy database. Updates th e id and i nsert new | |
| 56 | * customer in list. | |
| 57 | * | |
| 58 | * @param cu stomer | |
| 59 | * Customer object | |
| 60 | * @return c ustomer ob ject with updated id | |
| 61 | * / | |
| 62 | pu blic Custo mer create (Customer customer) { | |
| 63 | cust omer.setId (System.cu rrentTimeM illis()); | |
| 64 | cust omers.add( customer); | |
| 65 | retu rn custome r; | |
| 66 | } | |
| 67 | ||
| 68 | /* * | |
| 69 | * Delete th e customer object fr om dummy d atabase. I f customer not found for | |
| 70 | * given id, returns n ull. | |
| 71 | * | |
| 72 | * @param id | |
| 73 | * the cust omer id | |
| 74 | * @return i d of delet ed custome r object | |
| 75 | * / | |
| 76 | pu blic Long delete(Lon g id) { | |
| 77 | ||
| 78 | for (Customer c : custom ers) { | |
| 79 | if (c. getId().eq uals(id)) { | |
| 80 | customer s.remove(c ); | |
| 81 | return i d; | |
| 82 | } | |
| 83 | } | |
| 84 | ||
| 85 | retu rn null; | |
| 86 | } | |
| 87 | ||
| 88 | /* * | |
| 89 | * Update th e customer object fo r given id in dummy database. If custome r | |
| 90 | * not exist s, returns null | |
| 91 | * | |
| 92 | * @param id | |
| 93 | * @param cu stomer | |
| 94 | * @return c ustomer ob ject with id | |
| 95 | * / | |
| 96 | pu blic Custo mer update (Long id, Customer c ustomer) { | |
| 97 | ||
| 98 | for (Customer c : custom ers) { | |
| 99 | if (c. getId().eq uals(id)) { | |
| 100 | customer .setId(c.g etId()); | |
| 101 | customer s.remove(c ); | |
| 102 | customer s.add(cust omer); | |
| 103 | return c ustomer; | |
| 104 | } | |
| 105 | } | |
| 106 | ||
| 107 | retu rn null; | |
| 108 | } | |
| 109 | ||
| 110 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.