Returns the default value of type as defined by JLS --- 0 for numbers, false for boolean and '\0' for char. For non-primitive types and void, null is returned.
(Class<T> type)
| 60 | * {@code void}, {@code null} is returned. |
| 61 | */ |
| 62 | @Nullable |
| 63 | public static <T> T defaultValue(Class<T> type) { |
| 64 | // Primitives.wrap(type).cast(...) would avoid the warning, but we can't use that from here |
| 65 | @SuppressWarnings("unchecked") // the put method enforces this key-value relationship |
| 66 | T t = (T) DEFAULTS.get(checkNotNull(type)); |
| 67 | return t; |
| 68 | } |
| 69 | } |
nothing calls this directly
no test coverage detected