1 | static boolean isPrimitiveInstance(Class type, O arg) { |
2 | if (type == boolean.class) return arg instanceof Boolean; |
3 | if (type == int.class) return arg instanceof Integer; |
4 | if (type == long.class) return arg instanceof Long; |
5 | if (type == float.class) return arg instanceof Float; |
6 | if (type == short.class) return arg instanceof Short; |
7 | if (type == char.class) return arg instanceof Character; |
8 | if (type == byte.class) return arg instanceof Byte; |
9 | if (type == double.class) return arg instanceof Double; |
10 | false; |
11 | } |
Began life as a copy of #1000961
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021889 |
Snippet name: | isPrimitiveInstance |
Eternal ID of this version: | #1021889/1 |
Text MD5: | c5e23ee32a67d987d18b3ddf09f8080c |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-02 23:40:52 |
Source code size: | 529 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 247 / 278 |
Referenced in: | [show references] |