@GwtIncompatible public final class Defaults extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.Class<?>,java.lang.Object> |
DEFAULTS |
Modifier | Constructor and Description |
---|---|
private |
Defaults() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
defaultValue(java.lang.Class<T> type)
Returns the default value of
type as defined by JLS --- 0 for numbers, false for boolean and '\0' for char . |
private static <T> void |
put(java.util.Map<java.lang.Class<?>,java.lang.Object> map,
java.lang.Class<T> type,
T value) |
private static final java.util.Map<java.lang.Class<?>,java.lang.Object> DEFAULTS
private static <T> void put(java.util.Map<java.lang.Class<?>,java.lang.Object> map, java.lang.Class<T> type, T value)
@Nullable public static <T> T defaultValue(java.lang.Class<T> type)
type
as defined by JLS --- 0
for numbers, false
for boolean
and '\0'
for char
. For non-primitive types and
void
, null
is returned.