Top Description Fields Constructors Methods
com.google.common.base

public final Class Defaults

extends Object
Class Inheritance
Annotations
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkNotNull

This class provides default values for all Java types, as defined by the JLS.
Author
Ben Yu
Since
1.0

Field Summary

Modifier and TypeField and Description
private static final Double
private static final Float

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> T
defaultValue(Class<T> type)

Returns the default value of type as defined by JLS --- 0 for numbers, false for boolean and '\0' for char.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DOUBLE_DEFAULTback to summary
private static final Double DOUBLE_DEFAULT
FLOAT_DEFAULTback to summary
private static final Float FLOAT_DEFAULT

Constructor Detail

Defaultsback to summary
private Defaults()

Method Detail

defaultValueback to summary
public static <T> T defaultValue(Class<T> type)

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.

Annotations
@SuppressWarnings:unchecked
@CheckForNull