# LayoutElementBuilders.Layout

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/LayoutElementBuilders.java+class:androidx.wear.protolayout.LayoutElementBuilders.Layout) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
@RequiresSchemaVersion(major = 1, minor = 0)
public final class LayoutElementBuilders.Layout
```

<br />

*** ** * ** ***

A complete layout.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout.Builder` Builder for `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout` |

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/ProtoLayoutExperimental https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout#fromByteArray(byte[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray)` Converts from byte array representation. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout` | `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout#fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement layoutElement )` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout` object containing the given layout element. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement` | `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout#getRoot()()` Gets the root element in the layout. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[]` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/ProtoLayoutExperimental https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout#toByteArray()()` Converts to byte array representation. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout#toString()()` |

## Public methods

### fromByteArray

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

```
@ProtoLayoutExperimental
public static @Nullable LayoutElementBuilders.Layout fromByteArray(@NonNull byte[] byteArray)
```

Converts from byte array representation.

### fromLayoutElement

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

```
public static @NonNull LayoutElementBuilders.Layout fromLayoutElement(
    @NonNull LayoutElementBuilders.LayoutElement layoutElement
)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout` object containing the given layout element.

### getRoot

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

```
public @Nullable LayoutElementBuilders.LayoutElement getRoot()
```

Gets the root element in the layout.

### toByteArray

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

```
@ProtoLayoutExperimental
public @NonNull byte[] toByteArray()
```

Converts to byte array representation.

### toString

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