* Retrieves or creates the `AbstractLogic` for a given metadata key. * @param key The `MetadataKey` for which to get the logic. * @returns The `AbstractLogic` associated with the key.
(key: MetadataKey<any, T, any>)
| 326 | * @returns The `AbstractLogic` associated with the key. |
| 327 | */ |
| 328 | getMetadata<T>(key: MetadataKey<any, T, any>): AbstractLogic<T> { |
| 329 | cast<MetadataKey<unknown, unknown, unknown>>(key); |
| 330 | if (!this.metadata.has(key)) { |
| 331 | this.metadata.set(key, new MetadataMergeLogic(this.predicates, key)); |
| 332 | } |
| 333 | return this.metadata.get(key)! as AbstractLogic<T>; |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * Merges logic from another `Logic` instance into this one. |
no test coverage detected