1 | concept CSnippet implements _SetField {
|
2 | long id; // Whoa - clash with superclass field - and it still works |
3 | S type; |
4 | S title, md5; |
5 | O text; |
6 | |
7 | S text() { ret fromUtf8OrTokenList_generic(text); }
|
8 | |
9 | void legacyCompaction() {
|
10 | if (text instanceof S) cset(this, text := toUtf8_generic(text)); |
11 | } |
12 | |
13 | // speed up (?) reflection |
14 | public void _setField(S f, O x) {
|
15 | if (f.equals('id)) id = (long) x;
|
16 | else if (f.equals('type)) type = (S) x;
|
17 | else if (f.equals('title)) title = (S) x;
|
18 | else if (f.equals('md5)) md5 = (S) x;
|
19 | else if (f.equals('text)) text = x;
|
20 | } |
21 | |
22 | long snippetID() { ret id; }
|
23 | } |
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1014750 |
| Snippet name: | CSnippet (local snippets DB concept - don't confuse with CSnippet from #1016871) |
| Eternal ID of this version: | #1014750/7 |
| Text MD5: | fb95130a7298a91b410e21e769b0414f |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-11-14 15:58:02 |
| Source code size: | 646 bytes / 23 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 788 / 1621 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |