This returns well known empty values for well-known java types. This returns null for types not in the following list. [Bb]oolean byte[] Collection Iterator List Map Set When {@link Feig
(Type type)
| 212 | * looking at the raw type (vs type hierarchy). Decorate for sophistication. |
| 213 | */ |
| 214 | public static Object emptyValueOf(Type type) { |
| 215 | return EMPTIES.getOrDefault(Types.getRawType(type), () -> null).get(); |
| 216 | } |
| 217 | |
| 218 | private static final Map<Class<?>, Supplier<Object>> EMPTIES; |
| 219 |