|
| 1 | +// Copyright 2019 astonbitecode |
| 2 | +// This file is part of rust-keylock password manager. |
| 3 | +// |
| 4 | +// rust-keylock is free software: you can redistribute it and/or modify |
| 5 | +// it under the terms of the GNU General Public License as published by |
| 6 | +// the Free Software Foundation, either version 3 of the License, or |
| 7 | +// (at your option) any later version. |
| 8 | +// |
| 9 | +// rust-keylock is distributed in the hope that it will be useful, |
| 10 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +// GNU General Public License for more details. |
| 13 | +// |
| 14 | +// You should have received a copy of the GNU General Public License |
| 15 | +// along with rust-keylock. If not, see <http://www.gnu.org/licenses/>. |
| 16 | +package org.astonbitecode.rustkeylock.api.stubs; |
| 17 | + |
| 18 | +import org.astonbitecode.rustkeylock.utils.Defs; |
| 19 | + |
| 20 | +import java.util.HashMap; |
| 21 | +import java.util.Map; |
| 22 | + |
| 23 | +public class JavaMenu { |
| 24 | + |
| 25 | + public static Map<String, Object> EntriesList(String filter) { |
| 26 | + Map<String, Object> inner = new HashMap<>(); |
| 27 | + inner.put("filter", filter); |
| 28 | + Map<String, Object> map = new HashMap<>(); |
| 29 | + map.put(Defs.MENU_ENTRIES_LIST, inner); |
| 30 | + return map; |
| 31 | + } |
| 32 | + |
| 33 | + public static String Exit() { |
| 34 | + return Defs.MENU_EXIT; |
| 35 | + } |
| 36 | + |
| 37 | + public static String ForceExit() { |
| 38 | + return Defs.MENU_FORCE_EXIT; |
| 39 | + } |
| 40 | + |
| 41 | + public static String ChangePass() { |
| 42 | + return Defs.MENU_CHANGE_PASS; |
| 43 | + } |
| 44 | + |
| 45 | + public static Map<String, Object> Save(Boolean b) { |
| 46 | + Map<String, Object> inner = new HashMap<>(); |
| 47 | + inner.put("b", b); |
| 48 | + Map<String, Object> map = new HashMap<>(); |
| 49 | + map.put(Defs.MENU_SAVE, inner); |
| 50 | + return map; |
| 51 | + } |
| 52 | + |
| 53 | + public static Map<String, Object> TryPass(Boolean b) { |
| 54 | + Map<String, Object> inner = new HashMap<>(); |
| 55 | + inner.put("b", b); |
| 56 | + Map<String, Object> map = new HashMap<>(); |
| 57 | + map.put(Defs.MENU_TRY_PASS, inner); |
| 58 | + return map; |
| 59 | + } |
| 60 | + |
| 61 | + public static String ExportEntries() { |
| 62 | + return Defs.MENU_EXPORT_ENTRIES; |
| 63 | + } |
| 64 | + |
| 65 | + public static String ImportEntries() { |
| 66 | + return Defs.MENU_IMPORT_ENTRIES; |
| 67 | + } |
| 68 | + |
| 69 | + public static String ShowConfiguration() { |
| 70 | + return Defs.MENU_SHOW_CONFIGURATION; |
| 71 | + } |
| 72 | + |
| 73 | + public static String Main() { |
| 74 | + return Defs.MENU_MAIN; |
| 75 | + } |
| 76 | + |
| 77 | + public static String NewEntry() { |
| 78 | + return Defs.MENU_NEW_ENTRY; |
| 79 | + } |
| 80 | + |
| 81 | + public static Map<String, Object> ShowEntry(Integer idx) { |
| 82 | + Map<String, Object> inner = new HashMap<>(); |
| 83 | + inner.put("idx", idx); |
| 84 | + Map<String, Object> map = new HashMap<>(); |
| 85 | + map.put(Defs.MENU_SHOW_ENTRY, inner); |
| 86 | + return map; |
| 87 | + } |
| 88 | + |
| 89 | + public static Map<String, Object> EditEntry(Integer idx) { |
| 90 | + Map<String, Object> inner = new HashMap<>(); |
| 91 | + inner.put("idx", idx); |
| 92 | + Map<String, Object> map = new HashMap<>(); |
| 93 | + map.put(Defs.MENU_EDIT_ENTRY, inner); |
| 94 | + return map; |
| 95 | + } |
| 96 | + |
| 97 | + public static Map<String, Object> DeleteEntry(Integer idx) { |
| 98 | + Map<String, Object> inner = new HashMap<>(); |
| 99 | + inner.put("idx", idx); |
| 100 | + Map<String, Object> map = new HashMap<>(); |
| 101 | + map.put(Defs.MENU_DELETE_ENTRY, inner); |
| 102 | + return map; |
| 103 | + } |
| 104 | + |
| 105 | + public static Map<String, Object> SetDbToken(String token) { |
| 106 | + Map<String, Object> inner = new HashMap<>(); |
| 107 | + inner.put("token", token); |
| 108 | + Map<String, Object> map = new HashMap<>(); |
| 109 | + map.put(Defs.MENU_SET_DB_TOKEN, inner); |
| 110 | + return map; |
| 111 | + } |
| 112 | +} |
0 commit comments