Package org.jboss.resteasy.core
Class ResteasyContext
java.lang.Object
org.jboss.resteasy.core.ResteasyContext
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCloseableContextDataLevel(Map<Class<?>, Object> data) static voidstatic <T> TcomputeIfAbsent(Class<T> type, Supplier<T> newValue) Gets the current context for the type.static <T> TgetContextData(Class<T> type) static intgetContextDataMap(boolean create) static <T> TgetRequiredContextData(Class<T> type) Gets the current context for the type.static booleanhasContextData(Class<?> type) Checks the current context for the given type.static <T> TpopContextData(Class<T> type) static <T> voidpushContext(Class<T> type, T data) static voidpushContextDataMap(Map<Class<?>, Object> map) static voidstatic 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 thenewValuesupplier 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:
trueif 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
-