1 | static class RemoteDB { |
2 | DialogIO db; |
3 | |
4 | *(S botName) { |
5 | db = findBot(botName); |
6 | } |
7 | |
8 | L<PassRef> xlist(S className) { |
9 | ret (L<PassRef>) rpc(db, "xlist", className); |
10 | } |
11 | |
12 | S xclass(PassRef o) { |
13 | ret (S) rpc(db, "xclass", o); |
14 | } |
15 | |
16 | O xget(PassRef o, S field) { |
17 | ret rpc(db, "xget", o, field); |
18 | } |
19 | |
20 | S xS(PassRef o, S field) { |
21 | ret (S) xget(o, field); |
22 | } |
23 | |
24 | PassRef xgetref(PassRef o, S field) { |
25 | ret (PassRef) xget(o, field); |
26 | } |
27 | |
28 | void xset(PassRef o, S field, O value) { |
29 | rpc(db, "xset", o, field, value); |
30 | } |
31 | |
32 | PassRef unary(S className) { |
33 | PassRef ref = first(xlist(className)); |
34 | if (ref == null) |
35 | ref = xnew(className); |
36 | ret ref; |
37 | } |
38 | |
39 | PassRef xnew(S className, O... values) { |
40 | ret (PassRef) rpc(db, "xnew", className, values); |
41 | } |
42 | |
43 | void xdelete(PassRef o) { |
44 | rpc(db, "xdelete", o); |
45 | } |
46 | |
47 | void close() { |
48 | if (db != null) |
49 | db.close(); |
50 | } |
51 | } |
!include #1004681
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004925 |
Snippet name: | RemoteDB (old) |
Eternal ID of this version: | #1004925/2 |
Text MD5: | 4ae9fb45709d8d70fa8269caa2e56dba |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-03-26 21:00:31 |
Source code size: | 973 bytes / 51 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 565 / 584 |
Version history: | 1 change(s) |
Referenced in: | [show references] |