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

19
LINES

< > BotCompany Repo | #1006614 // getConcept

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (12753L/86K).

static Concept getConcept(long id) {
  ret db_mainConcepts().getConcept(id);
}

static Concept getConcept(Concepts concepts, long id) {
  ret concepts.getConcept(id);
}
 
static <A extends Concept> A nuLike getConcept(Class<A> cc, long id) {
  ret getConcept(db_mainConcepts(), cc, id);
}

static <A extends Concept> A getConcept(Concepts concepts, Class<A> cc, long id) {
  Concept c = concepts.getConcept(id);
  if (c == null) null;
  if (!isInstance(cc, c))
    fail("Can't convert concept: " + getClassName(c) + " -> " + getClassName(cc) + " (" + id + ")");
  ret (A) c;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006614
Snippet name: getConcept
Eternal ID of this version: #1006614/5
Text MD5: 53b634687960c030d798db33f64b58bd
Transpilation MD5: 1e1e0b8b5aa523785be9991a000c321f
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-10 14:09:09
Source code size: 596 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 715 / 789
Version history: 4 change(s)
Referenced in: [show references]