Package com.day.cq.wcm.api
Enum DebugFlag
- java.lang.Object
-
- java.lang.Enum<DebugFlag>
-
- com.day.cq.wcm.api.DebugFlag
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEBUG_PARAM_NAME
Default parameter name of the debug request parameterstatic java.lang.String
REQUEST_ATTRIBUTE_NAME
name of the request attribute
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<DebugFlag>
fromRequest(ServletRequest req)
Returns the debug mode for the current request, if set in the request attributesstatic java.util.Set<DebugFlag>
fromRequestParameter(ServletRequest request, java.lang.String parameterName)
Return the current set of debug modes defined by supplied request parameter.static DebugFlag
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DebugFlag[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Field Detail
-
REQUEST_ATTRIBUTE_NAME
public static final java.lang.String REQUEST_ATTRIBUTE_NAME
name of the request attribute
-
DEBUG_PARAM_NAME
public static final java.lang.String DEBUG_PARAM_NAME
Default parameter name of the debug request parameter- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static DebugFlag[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DebugFlag c : DebugFlag.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DebugFlag valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromRequest
public static java.util.Set<DebugFlag> fromRequest(ServletRequest req)
Returns the debug mode for the current request, if set in the request attributes- Parameters:
req
- request- Returns:
- debug mode, empty Set if not defined in request attributes
-
fromRequestParameter
public static java.util.Set<DebugFlag> fromRequestParameter(ServletRequest request, java.lang.String parameterName)
Return the current set of debug modes defined by supplied request parameter. If the set was already stored in the request attributes, return that.- Parameters:
request
- the current requestparameterName
- the (multi-valued) request parameter that defines debug modes- Returns:
- the Set of DebugFlag, from request attributes if present, else computed, empty Set if no debug modes defined.
-
-