Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

23
LINES

< > BotCompany Repo | #1014750 // CSnippet (local snippets DB concept - don't confuse with CSnippet from #1016871)

JavaX fragment (include)

concept CSnippet implements _SetField {
  long id; // Whoa - clash with superclass field - and it still works
  S type;
  S title, md5;
  O text;
  
  S text() { ret fromUtf8OrTokenList_generic(text); }
  
  void legacyCompaction() {
    if (text instanceof S) cset(this, text := toUtf8_generic(text));
  }
  
  // speed up (?) reflection
  public void _setField(S f, O x) {
    if (f.equals('id)) id = (long) x;
    else if (f.equals('type)) type = (S) x;
    else if (f.equals('title)) title = (S) x;
    else if (f.equals('md5)) md5 = (S) x;
    else if (f.equals('text)) text = x;
  }
  
  long snippetID() { ret id; }
}

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: 440 / 1247
Version history: 6 change(s)
Referenced in: [show references]