Package com.google.common.base
Class Defaults
- java.lang.Object
-
- com.google.common.base.Defaults
-
@GwtIncompatible public final class Defaults extends Object
This class provides default values for all Java types, as defined by the JLS.- Since:
- 1.0
- Author:
- Ben Yu
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> @Nullable T
defaultValue(Class<T> type)
Returns the default value oftype
as defined by JLS ---0
for numbers,false
forboolean
and'\0'
forchar
.
-
-
-
Method Detail
-
defaultValue
public static <T> @Nullable T defaultValue(Class<T> type)
Returns the default value oftype
as defined by JLS ---0
for numbers,false
forboolean
and'\0'
forchar
. For non-primitive types andvoid
,null
is returned.
-
-