> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

# ContractWithKey

> A superclass for all codegen-generated Contracts whose templates have a key defined.

## ContractWithKey - stable

Upstream docs: [Open](https://javadoc.io/doc/com.daml/bindings-java/3.4.11/com/daml/ledger/javaapi/data/codegen/ContractWithKey.html)

**Signature**

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
public abstract class ContractWithKey<Id,Data,Key> extends Contract<Id,Data>
```

**Members**

| Docs                                                                                                                                                | Member             | Introduced | Deprecated | Removed |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ---------- | ---------- | ------- |
| [Open](https://javadoc.io/doc/com.daml/bindings-java/3.4.11/com/daml/ledger/javaapi/data/codegen/ContractWithKey.html#equals%28java.lang.Object%29) | `equals(Object)`   | `3.4.8`    | -          | -       |
| [Open](https://javadoc.io/doc/com.daml/bindings-java/3.4.11/com/daml/ledger/javaapi/data/codegen/ContractWithKey.html#hashCode%28%29)               | `hashCode()`       | `3.4.8`    | -          | -       |
| [Open](https://javadoc.io/doc/com.daml/bindings-java/3.4.11/com/daml/ledger/javaapi/data/codegen/ContractWithKey.html#key)                          | `key`              | `3.4.8`    | -          | -       |
| [Open](https://javadoc.io/doc/com.daml/bindings-java/3.4.11/com/daml/ledger/javaapi/data/codegen/ContractWithKey.html#keyJsonEncoder%28%29)         | `keyJsonEncoder()` | `3.4.8`    | -          | -       |
| [Open](https://javadoc.io/doc/com.daml/bindings-java/3.4.11/com/daml/ledger/javaapi/data/codegen/ContractWithKey.html#keyToJson%28%29)              | `keyToJson()`      | `3.4.8`    | -          | -       |
| [Open](https://javadoc.io/doc/com.daml/bindings-java/3.4.11/com/daml/ledger/javaapi/data/codegen/ContractWithKey.html#toString%28%29)               | `toString()`       | `3.4.8`    | -          | -       |
