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

15
LINES

< > BotCompany Repo | #1006614 - getConcept

JavaX fragment (include)

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

static <A extends Concept> A 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   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1006614
Snippet name: getConcept
Eternal ID of this version: #1006614/2
Text MD5: ac41c704bbfcbeed99ee3436a9bcf446
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-07 15:49:31
Source code size: 492 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 313 / 286
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1006614 & http://1006614.tinybrain.de