Class DebugEnablement.Builder

java.lang.Object
org.apache.juneau.rest.debug.DebugEnablement.Builder
Enclosing class:
DebugEnablement

public static class DebugEnablement.Builder extends Object
Builder class.
  • Constructor Details

    • Builder

      protected Builder(BeanStore beanStore)
      Constructor.
      Parameters:
      beanStore - The bean store to use for creating beans.
  • Method Details

    • build

      Creates a new DebugEnablement object from this builder. s

      Instantiates an instance of the implementation class or else BasicDebugEnablement if implementation class was not specified.

      Returns:
      A new DebugEnablement object.
    • type

      Specifies a subclass of DebugEnablement to create when the build() method is called.
      Parameters:
      value - The new value for this setting.
      Returns:
      This object.
    • impl

      Specifies an already-instantiated bean for the build() method to return.
      Parameters:
      value - The setting value.
      Returns:
      This object.
    • enable

      public DebugEnablement.Builder enable(Enablement enablement, String... keys)
      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:
      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.
      Returns:
      This object.
    • enable

      public DebugEnablement.Builder enable(Enablement enablement, Class<?>... classes)
      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:
      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.