Class ResteasyContext
java.lang.Object
org.jboss.resteasy.core.ResteasyContext
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCloseableContextDataLevel
(Map<Class<?>, Object> data) static void
static <T> T
computeIfAbsent
(Class<T> type, Supplier<T> newValue) Gets the current context for the type.static <T> T
getContextData
(Class<T> type) static int
getContextDataMap
(boolean create) static <T> T
getRequiredContextData
(Class<T> type) Gets the current context for the type.static boolean
hasContextData
(Class<?> type) Checks the current context for the given type.static <T> T
popContextData
(Class<T> type) static <T> void
pushContext
(Class<T> type, T data) static void
pushContextDataMap
(Map<Class<?>, Object> map) static void
static Object
-
Constructor Details
-
ResteasyContext
public ResteasyContext()
-
-
Method Details
-
pushContext
-
pushContextDataMap
-
getContextDataMap
-
getContextData
-
getRequiredContextData
Gets the current context for the type. If not found in the current context a IllegalArgumentException is thrown.- Type Parameters:
T
- the type of the lookup- Parameters:
type
- the type to lookup in the context map- Returns:
- the context data
- Throws:
IllegalArgumentException
- if the type is not found in the current context
-
computeIfAbsent
Gets the current context for the type. If the context does not exist the value is resolved from thenewValue
supplier and pushed to the current context.- Type Parameters:
T
- the type to lookup- Parameters:
type
- the type to lookup in the context mapnewValue
- the new value if the value was not already setup in the value map- Returns:
- the context data
-
hasContextData
Checks the current context for the given type.- Parameters:
type
- the type to check the context data- Returns:
true
if the type exists in the current contexts data, otherwisefalse
-
popContextData
-
clearContextData
public static void clearContextData() -
getContextDataMap
-
addContextDataLevel
-
addCloseableContextDataLevel
-
addCloseableContextDataLevel
public static ResteasyContext.CloseableContext addCloseableContextDataLevel(Map<Class<?>, Object> data) -
getContextDataLevelCount
public static int getContextDataLevelCount() -
removeContextDataLevel
public static void removeContextDataLevel() -
searchContextData
-