Class ResteasyContext

java.lang.Object
org.jboss.resteasy.core.ResteasyContext

public final class ResteasyContext extends Object
  • Constructor Details

    • ResteasyContext

      public ResteasyContext()
  • Method Details

    • 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
    • hasContextData

      public static boolean hasContextData(Class<?> type)
      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, otherwise false
    • 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()
    • addCloseableContextDataLevel

      public static ResteasyContext.CloseableContext addCloseableContextDataLevel()
    • addCloseableContextDataLevel

      public static ResteasyContext.CloseableContext addCloseableContextDataLevel(Map<Class<?>,Object> data)
    • getContextDataLevelCount

      public static int getContextDataLevelCount()
    • removeContextDataLevel

      public static void removeContextDataLevel()
    • searchContextData

      public static Object searchContextData(Object o)