# Class NamedToolPredicate

java.lang.Object
com.google.adk.tools.NamedToolPredicate

All Implemented Interfaces:
  `ToolPredicate`

public class NamedToolPredicate extends Object implements ToolPredicate

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NamedToolPredicate(String... toolNames)`
  `NamedToolPredicate(List<String> toolNames)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `test(BaseTool tool, Optional<ReadonlyContext> readonlyContext)`
  Decides if the given tool is selected.

  ### Methods inherited from class Object

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

  ### Methods inherited from interface ToolPredicate

  `test`
  Modifier and Type
  Method
  Description
  `default boolean`
  `test(BaseTool tool, @Nullable ReadonlyContext readonlyContext)`
  Decides if the given tool is selected.

- ## Constructor Details

  - ### NamedToolPredicate

    public NamedToolPredicate(List<String> toolNames)

  - ### NamedToolPredicate

    public NamedToolPredicate(String... toolNames)

- ## Method Details

  - ### test

    public boolean test(BaseTool tool, Optional<ReadonlyContext> readonlyContext)
    Description copied from interface: `ToolPredicate`
    Decides if the given tool is selected.
    Specified by:
      `test` in interface `ToolPredicate`
    Parameters:
      `tool` - The tool to check.
      `readonlyContext` - The current context.
    Returns:
      true if the tool should be selected, false otherwise.