Class ContextSession.Builder

java.lang.Object
org.apache.juneau.ContextSession.Builder
Direct Known Subclasses:
BeanSession.Builder, RestOpSession.Builder, RestSession.Builder
Enclosing class:
ContextSession

public abstract static class ContextSession.Builder extends Object
Builder class.
  • Constructor Details

    • Builder

      protected Builder(Context ctx)
      Constructor.
      Parameters:
      ctx - The context creating this session.
  • Method Details

    • build

      public abstract ContextSession build()
      Build the object.
      Returns:
      The built object.
    • debug

      Debug mode.

      Enables the following additional information during parsing:

      • When bean setters throws exceptions, the exception includes the object stack information in order to determine how that method was invoked.

      If not specified, defaults to Context.Builder.debug().

      See Also:
      Parameters:
      value - The new value for this property.
      Can be null. Value will be ignored.
      Returns:
      This object.
    • unmodifiable

      Create an unmodifiable session.

      The created ContextSession object will be unmodifiable which makes it suitable for caching and reuse.

      Returns:
      This object.
    • properties

      Session properties.

      Session properties are generic key-value pairs that can be passed through the session and made available to any customized serializers/parsers or swaps.

      Parameters:
      value - The new value for this property.
      Can be null.
      Returns:
      This object.
    • property

      Adds a property to this session.
      Parameters:
      key - The property key.
      value - The property value.
      Returns:
      This object.
    • apply

      public <T> ContextSession.Builder apply(Class<T> type, Consumer<T> apply)
      Applies a consumer to this builder if it's the specified type.
      Type Parameters:
      T - The expected type.
      Parameters:
      type - The expected type.
      apply - The consumer to apply.
      Returns:
      This object.