Package org.apache.juneau.rest.debug
Class DebugEnablement.Builder
java.lang.Object
org.apache.juneau.rest.debug.DebugEnablement.Builder
- Enclosing class:
DebugEnablement
Builder class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a newDebugEnablement
object from this builder.conditional
(Predicate<jakarta.servlet.http.HttpServletRequest> value) Specifies the predicate to use for conditional debug enablement.defaultEnable
(Enablement value) Specifies the default debug enablement setting if not overridden per class/method.enable
(Enablement enablement, Class<?>... classes) Enables or disables debug on the specified classes.enable
(Enablement enablement, String... keys) Enables or disables debug on the specified classes and/or methods.impl
(DebugEnablement value) Specifies an already-instantiated bean for thebuild()
method to return.type
(Class<? extends DebugEnablement> value) Specifies a subclass ofDebugEnablement
to create when thebuild()
method is called.
-
Constructor Details
-
Builder
Constructor.- Parameters:
beanStore
- The bean store to use for creating beans.
-
-
Method Details
-
build
Creates a newDebugEnablement
object from this builder. sInstantiates an instance of the
implementation class
or elseBasicDebugEnablement
if implementation class was not specified.- Returns:
- A new
DebugEnablement
object.
-
type
Specifies a subclass ofDebugEnablement
to create when thebuild()
method is called.- Parameters:
value
- The new value for this setting.- Returns:
- This object.
-
impl
Specifies an already-instantiated bean for thebuild()
method to return.- Parameters:
value
- The setting value.- Returns:
- This object.
-
enable
Enables or disables debug on the specified classes and/or methods.Allows you to target specified debug enablement on specified classes and/or methods.
- Parameters:
enablement
- The debug enablement setting to set on the specified classes/methods.
Can be any of the following:ALWAYS
- Debug is always enabled.NEVER
- Debug is always disabled.CONDITIONAL
- Debug is enabled when theconditional(Predicate)
conditional predicate test} passes.
keys
- The mapping keys.
Can be any of the following:- Full class name (e.g.
"com.foo.MyClass" ). - Simple class name (e.g.
"MyClass" ). - All classes (e.g.
"*" ). - Full method name (e.g.
"com.foo.MyClass.myMethod" ). - Simple method name (e.g.
"MyClass.myMethod" ). - A comma-delimited list of anything on this list.
- Full class name (e.g.
- Returns:
- This object.
-
enable
Enables or disables debug on the specified classes.Identical to
enable(Enablement, String...)
but allows you to specify specific classes.- Parameters:
enablement
- The debug enablement setting to set on the specified classes/methods.
Can be any of the following:ALWAYS
- Debug is always enabled.NEVER
- Debug is always disabled.CONDITIONAL
- Debug is enabled when theconditional(Predicate)
conditional predicate test} passes.
classes
- The classes to set the debug enablement setting on.- Returns:
- This object.
-
defaultEnable
Specifies the default debug enablement setting if not overridden per class/method.The default value for this setting is
NEVER
.- Parameters:
value
- The default debug enablement setting if not overridden per class/method.- Returns:
- This object.
-
conditional
public DebugEnablement.Builder conditional(Predicate<jakarta.servlet.http.HttpServletRequest> value) Specifies the predicate to use for conditional debug enablement.Specifies the predicate to use to determine whether debug is enabled when the resolved enablement value is
CONDITIONAL
.The default value for this setting is
( .x )->"true" .equalsIgnoreCase(x .getHeader("Debug" ))- Parameters:
value
- The predicate.- Returns:
- This object.
-