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

7
LINES

< > BotCompany Repo | #1029931 // getConceptOpt - return null if wrong type

JavaX fragment (include)

static <A extends Concept> A nuLike getConceptOpt(Class<A> cc, long id) {
  ret getConceptOpt(db_mainConcepts(), cc, id);
}

static <A extends Concept> A getConceptOpt(Concepts concepts, Class<A> cc, long id) {
  ret concepts == null ? null : optCast(cc, concepts.getConcept(id));
}

Author comment

Began life as a copy of #1006614

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1029931
Snippet name: getConceptOpt - return null if wrong type
Eternal ID of this version: #1029931/2
Text MD5: 4924829721519482a0cb931f8db931ae
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-10-08 13:49:18
Source code size: 290 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 129 / 162
Version history: 1 change(s)
Referenced in: [show references]