Class ResteasyContext


  • public final class ResteasyContext
    extends Object
    • Constructor Detail

      • ResteasyContext

        public ResteasyContext()
    • Method Detail

      • pushContext

        public static <T> void pushContext​(Class<T> type,
                                           T data)
      • pushContextDataMap

        public static void pushContextDataMap​(Map<Class<?>,​Object> map)
      • getContextDataMap

        public static Map<Class<?>,​Object> getContextDataMap()
      • getContextData

        public static <T> T getContextData​(Class<T> type)
      • getRequiredContextData

        public static <T> T getRequiredContextData​(Class<T> type)
        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

        public static <T> T computeIfAbsent​(Class<T> type,
                                            Supplier<T> newValue)
        Gets the current context for the type. If the context does not exist the value is resolved from the newValue supplier and pushed to the current context.
        Type Parameters:
        T - the type to lookup
        Parameters:
        type - the type to lookup in the context map
        newValue - the new value if the value was not already setup in the value map
        Returns:
        the context data
      • popContextData

        public static <T> T popContextData​(Class<T> type)
      • clearContextData

        public static void clearContextData()
      • getContextDataMap

        public static Map<Class<?>,​Object> getContextDataMap​(boolean create)
      • addContextDataLevel

        public static Map<Class<?>,​Object> addContextDataLevel()
      • getContextDataLevelCount

        public static int getContextDataLevelCount()
      • removeContextDataLevel

        public static void removeContextDataLevel()
      • searchContextData

        public static Object searchContextData​(Object o)