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

6
LINES

< > BotCompany Repo | #1005326 // singleFieldName - find name of the single defined field in class (not going to superclasses) or fail

JavaX fragment (include)

static S singleFieldName(Class c) {
  Set<S> l = listFields(c);
  if (l(l) != 1)
    fail("No single field found in " + c + " (have " + n(l(l), "fields") + ")");
  ret first(l);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005326
Snippet name: singleFieldName - find name of the single defined field in class (not going to superclasses) or fail
Eternal ID of this version: #1005326/1
Text MD5: 110cb71319818bfcb6073401bfb842e0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-11-05 18:46:38
Source code size: 184 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 459 / 470
Referenced in: [show references]