-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuManager.java
More file actions
63 lines (56 loc) · 2 KB
/
MenuManager.java
File metadata and controls
63 lines (56 loc) · 2 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package basicpwmanager;
import java.util.List;
/**
*
* @author HD
*/
public class MenuManager {
/**
* printMenu() method for printing out the possible options.
*
* @param retrievalManager
*/
public static void printMenu(RetrievalManager retrievalManager) {
String selection;
do {
System.out.println("============================");
System.out.println("Please select the following:");
System.out.println("1) Search");
System.out.println("2) Store");
System.out.println("3) Print");
System.out.println("4) Exit");
System.out.println("============================");
selection = Util.sc.next();
switch (selection) {
case "1":
System.out.println("Searching...");
SearchManager.searchCall();
break;
case "2":
System.out.println("Calling AccountManager...");
List<String> accDet = AccountManager.setAccountDetails();
// List<String> accDet = ListOfData.AccountDetails;
if (null == accDet) {
break;
}
retrievalManager.storeLocalAccountDetails(accDet);
break;
case "3":
System.out.println("Printing...");
retrievalManager.printStorageAccMap();
break;
case "4":
System.out.println("Exiting...");
retrievalManager.saveAccountDetails();
return;
default:
System.out.println("Please input the right option.");
}
} while (!"4".equals(selection));
}
}