# A2uiCreateSurfaceMessage

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/protocol/A2uiServerToClientMessage.kt+class:androidx.a2ui.model.protocol.A2uiCreateSurfaceMessage) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
public final class A2uiCreateSurfaceMessage implements A2uiServerToClientMessage
```

<br />

*** ** * ** ***

Creates a new surface instance on the client.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#A2uiCreateSurfaceMessage(kotlin.String,kotlin.String,kotlin.collections.Map,kotlin.Boolean)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html surfaceId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html catalogId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html> theme, boolean shouldSendDataModel )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#getCatalogId()()` The ID of the component catalog to use for this surface. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#getSurfaceId()()` The unique ID to assign to the new surface. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html>` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#getTheme()()` An optional map of theme-specific property overrides (e.g., colors, spacing). |
| `int` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#shouldSendDataModel()()` If true, the client will append its active UI data model state tree as metadata to subsequent outgoing messages. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#toString()()` |

## Public constructors

### A2uiCreateSurfaceMessage

```
public A2uiCreateSurfaceMessage(
    @NonNull String surfaceId,
    @NonNull String catalogId,
    @NonNull Map<@NonNull String, Object> theme,
    boolean shouldSendDataModel
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getCatalogId

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
public final @NonNull String getCatalogId()
```

The ID of the component catalog to use for this surface.

### getSurfaceId

```
public @NonNull String getSurfaceId()
```

The unique ID to assign to the new surface.

### getTheme

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
public final @NonNull Map<@NonNull String, Object> getTheme()
```

An optional map of theme-specific property overrides (e.g., colors, spacing).

### hashCode

```
public int hashCode()
```

### shouldSendDataModel

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
public final boolean shouldSendDataModel()
```

If true, the client will append its active UI data model state tree as metadata to subsequent outgoing messages. Defaults to false.

### toString

```
public @NonNull String toString()
```