# Class BaseAgent.Builder<B extends BaseAgent.Builder<B>>

java.lang.Object
com.google.adk.agents.BaseAgent.Builder<B>

Type Parameters:
  `B` - The concrete builder type.

Direct Known Subclasses:
  `LlmAgent.Builder, LoopAgent.Builder, ParallelAgent.Builder, PlannerAgent.Builder, SequentialAgent.Builder`

Enclosing class:
  `BaseAgent`

public abstract static class BaseAgent.Builder<B extends BaseAgent.Builder<B>> extends Object
Base Builder for all agents.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected com.google.common.collect.ImmutableList<Callbacks.AfterAgentCallback>`
  `afterAgentCallback`
  `protected com.google.common.collect.ImmutableList<Callbacks.BeforeAgentCallback>`
  `beforeAgentCallback`
  `protected String`
  `description`
  `protected String`
  `name`
  `protected com.google.common.collect.ImmutableList<BaseAgent>`
  `subAgents`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `B`
  `afterAgentCallback(Callbacks.AfterAgentCallback afterAgentCallback)`
  `B`
  `afterAgentCallback(List<com.google.adk.agents.Callbacks.AfterAgentCallbackBase> afterAgentCallback)`
  `B`
  `beforeAgentCallback(Callbacks.BeforeAgentCallback beforeAgentCallback)`
  `B`
  `beforeAgentCallback(List<com.google.adk.agents.Callbacks.BeforeAgentCallbackBase> beforeAgentCallback)`
  `abstract BaseAgent`
  `build()`
  `B`
  `description(String description)`
  `B`
  `name(String name)`
  `protected B`
  `self()`
  This is a safe cast to the concrete builder type.
  `B`
  `subAgents(BaseAgent... subAgents)`
  `B`
  `subAgents(List<? extends BaseAgent> subAgents)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### name

    protected String name

  - ### description

    protected String description

  - ### subAgents

    protected com.google.common.collect.ImmutableList<BaseAgent> subAgents

  - ### beforeAgentCallback

    protected com.google.common.collect.ImmutableList<Callbacks.BeforeAgentCallback> beforeAgentCallback

  - ### afterAgentCallback

    protected com.google.common.collect.ImmutableList<Callbacks.AfterAgentCallback> afterAgentCallback

- ## Constructor Details

  - ### Builder

    public Builder()

- ## Method Details

  - ### self

    protected B self()
    This is a safe cast to the concrete builder type.

  - ### name

    @CanIgnoreReturnValue public B name(String name)

  - ### description

    @CanIgnoreReturnValue public B description(String description)

  - ### subAgents

    @CanIgnoreReturnValue public B subAgents(List<? extends BaseAgent> subAgents)

  - ### subAgents

    @CanIgnoreReturnValue public B subAgents(BaseAgent... subAgents)

  - ### beforeAgentCallback

    @CanIgnoreReturnValue public B beforeAgentCallback(Callbacks.BeforeAgentCallback beforeAgentCallback)

  - ### beforeAgentCallback

    @CanIgnoreReturnValue public B beforeAgentCallback(List<com.google.adk.agents.Callbacks.BeforeAgentCallbackBase> beforeAgentCallback)

  - ### afterAgentCallback

    @CanIgnoreReturnValue public B afterAgentCallback(Callbacks.AfterAgentCallback afterAgentCallback)

  - ### afterAgentCallback

    @CanIgnoreReturnValue public B afterAgentCallback(List<com.google.adk.agents.Callbacks.AfterAgentCallbackBase> afterAgentCallback)

  - ### build

    public abstract BaseAgent build()