| Modifier and Type | Method and Description |
|---|---|
static Context |
emptyContext()
Returns an immutable empty
Context. |
static <T> T |
find(Object localContextProvider,
Class<T> type)
Finds an instance of the specified type in the local context of the provided
LocalContextProvider. |
static Context |
getLocalContext(Object localContextProvider)
Gets the local
Context of a LocalContextProvider. |
public static Context emptyContext()
Context.public static Context getLocalContext(Object localContextProvider)
Context of a LocalContextProvider.localContextProvider - a LocalContextProviderClassCastException - if localContextProvider does not implement LocalContextProviderpublic static <T> T find(Object localContextProvider, Class<T> type)
LocalContextProvider. If the local context has more than one instance of the specified type, the first one
found will be returned.T - the specified typelocalContextProvider - a LocalContextProvidertype - the specified typenull if no instance was found or if localContextProvider does not implement LocalContextProvider.
TODO: return Optional?Copyright © 2012–2017 Drombler. All rights reserved.