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

10
LINES

< > BotCompany Repo | #1029588 // typeToClass

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

Transpiled version (50L) is out of date.

static Class typeToClass(Type type) {
  if (type == null) null;
  if (type cast Class) ret type;
  if (type cast ParameterizedType) ret optCast Class(type.getRawType());
  if (type cast GenericArrayType)
    ret typeToClass(type.getGenericComponentType()).arrayType();
  if (type cast IResolvableClass)
    ret type.resolveToClass();
  null;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029588
Snippet name: typeToClass
Eternal ID of this version: #1029588/3
Text MD5: ae92d6e25f57d3d151569a447894b331
Author: stefan
Category: javax / reflection
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-13 18:46:44
Source code size: 352 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 247 / 358
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1036464 - resolvableClassToName