> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# ObjRefMap

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: class
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/_staging/metadata/objRefMap.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Utility class that assists with type-agnostic mapping of metadata objects by ObjRef.

Problem =======

The challenges with ObjRef's start in context of backend that supports both uri and id ref (e.g. bear) and the client.

Backend according to contract creates one type of ref - uri ref - so that is fine. However when instances of `ref` are created by the client code and are passed in through the public API (as is the case with the dashboard component) - problems start.

For clients it is often more convenient to use ID refs.. because they are transferable across workspaces and because they appear in the catalog export.

Doing strict ref-to-ref matching between user input and the data stored in state will result in no matches because the types of ref's do not match.

\-\-\-

This class addresses the problem by having the `get` method check the type of ObjRef first and then perform lookups into either id to item or uri to item mapping.

**Signature:**

```typescript
export declare class ObjRefMap<T> 
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [[Symbol.toStringTag]](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.objrefmap/index.md) | `readonly` | string | **_(ALPHA)_** |
| [fromItems](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.objrefmap/index.md#objrefmapfromitems) |  | (items: ReadonlyArray&lt;T&gt;) =&gt; [ObjRefMap](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.objrefmap/index.md)&lt;T&gt; | **_(ALPHA)_** |
| [size](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.objrefmap/index.md#objrefmapsize) |  | number | **_(ALPHA)_** |

## Property details

### ObjRefMap.fromItems

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

**Signature:**

```typescript
fromItems: (items: ReadonlyArray<T>) => ObjRefMap<T>;
```

### ObjRefMap.size

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

**Signature:**

```typescript
size: number;
```
