Package com.android.utils
Interface DateProvider
-
public interface DateProviderProvides abstraction over @{link Date#Date()}, to allow code to swap out calls to system date by a fake date in tests to create reliable tests.
-
-
Field Summary
Fields Modifier and Type Field Description static DateProviderSYSTEMImplementation that calls to the real @{link Date#Date()}.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Datenow()Provides this DataProvider's notion of 'now'.
-
-
-
Field Detail
-
SYSTEM
static final DateProvider SYSTEM
Implementation that calls to the real @{link Date#Date()}. This should never be called through directly in code. The right pattern is to create a variable and assign that variable toSYSTEMupon initialization and override the variable in tests.
-
-