---
title: "PlanCatalog"
description: "Looks up immutable build plans by name."
kind: "class"
id: "example.runtime.PlanCatalog"
module: "runtime-kit"
version: "1.0"
---

# ◆ PlanCatalog

[runtime-kit](../../index.md) › [example.runtime](index.md) · Every page: [llms.txt](../../llms.txt)

Class in [`example.runtime`](index.md). Since 1.0. Reference types generally default to non-null in this null-marked scope. [`runtime-kit.jar`](../../build-info/jvm-artifacts.html#artifact-1) · Java 17 · bytecode 61.0. [`runtime-kit.jar`](../../build-info/jvm-artifacts.html#artifact-1) · Java 21 entry · Java 21 · bytecode 65.0. [`runtime-kit.jmod`](../../build-info/jvm-artifacts.html#artifact-2) · Java 17 · bytecode 61.0. [`classes-21 (classes)`](../../build-info/jvm-artifacts.html#artifact-3) · Java 21 · bytecode 65.0.

Annotation contracts include safe for concurrent use.

```java
@ThreadSafe
public final class PlanCatalog
```

Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html) > `PlanCatalog`

Looks up immutable build plans by name.

```java
var catalog = new PlanCatalog(Map.of("app", BuildPlan.defaults("example.Main")));
var plan = catalog.find("app");
```

**See also**

- [`BuildPlan`](BuildPlan.md)
- [Feature tour](../../guides/feature-tour.md)

## Fields

### FORMAT_VERSION
<a id="FORMAT_VERSION"></a>`public static final int FORMAT_VERSION`. The catalog format version. Cite: `example/runtime/PlanCatalog.html#FORMAT_VERSION`
Constant value: `1`.

## Constructors

### PlanCatalog(Map)
<a id="&lt;init&gt;(java.util.Map)"></a>`public PlanCatalog(Map<String, BuildPlan> plans)`. Creates a catalog from a snapshot of the supplied plans. Cite: `example/runtime/PlanCatalog.html#<init>(java.util.Map)`
Parameters: `plans` `Map<String, BuildPlan>` (non-null, implied by @NullMarked on package example.runtime): the named plans to copy.

## Methods

### find(String)
<a id="find(java.lang.String)"></a>`@HotPath public @Nullable BuildPlan find(String name)`. Looks up the plan associated with a name. Cite: `example/runtime/PlanCatalog.html#find(java.lang.String)`
Annotation contracts include latency-sensitive.
Parameters: `name` `String` (non-null, implied by @NullMarked on package example.runtime): the catalog key.
Returns `@Nullable BuildPlan` (nullable): the matching plan, or null on a miss.
API note: Use `names()` to list the available keys.
Implementation requirements: Lookup does not modify the catalog.
Implementation note: Keys are compared using [`String.equals(Object)`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html#equals%28java.lang.Object%29).

### names()
<a id="names()"></a>`public List<@NonNull String> names()`. Returns the available keys in sorted order. Cite: `example/runtime/PlanCatalog.html#names()`
Returns `List<@NonNull String>` (non-null, implied by @NullMarked on package example.runtime): the keys, which are non-null.

### lookup(String)
<a id="lookup(java.lang.String)"></a>`@NullUnmarked @Deprecated(since = "1.0", forRemoval = true) public BuildPlan lookup(String name)`. Deprecated for removal since 1.0. Cite: `example/runtime/PlanCatalog.html#lookup(java.lang.String)`
Use `find(String)` for an explicit nullness contract.
Returns a plan through the legacy lookup contract.
Annotation contracts include null-unmarked.
Parameters: `name` `String`: the catalog key.
Returns `BuildPlan`: the lookup result.

## Inherited members

- From class [`Object`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait%28long,int%29)
