Looks up a primitive class by name. @param name the primitive type name @return the corresponding Class object, or null if not a primitive
(String name)
| 85 | * @return the corresponding Class object, or {@code null} if not a primitive |
| 86 | */ |
| 87 | protected static Class<?> forNamePrimitive(String name) { |
| 88 | if (name.length() <= 8) { |
| 89 | int p = Arrays.binarySearch(PRIMITIVE_NAMES, name); |
| 90 | if (p >= 0) { |
| 91 | return PRIMITIVES[p]; |
| 92 | } |
| 93 | } |
| 94 | return null; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Converts an array of Class names to Class types. |