# DynamicBuilders.DynamicBool

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

*** ** * ** ***

<br />

```
@RequiresSchemaVersion(major = 1, minor = 200)
public interface DynamicBuilders.DynamicBool extends DynamicBuilders.DynamicType
```

<br />

*** ** * ** ***

Interface defining a dynamic boolean type.

## Summary

| ### Public methods |
|---|---|
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#and(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool input)` Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` and `input` are both true, otherwise it is false. i.e. `boolean result = this && input` |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#constant(boolean)(boolean constant)` Creates a constant-valued `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#eq(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool other)` Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if the value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` and `other` are equal, otherwise it's false. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool> dynamicDataKey )` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is bound to the value of an item of the State. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#fromByteArray(byte[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray)` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` from a byte array generated by `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#toDynamicBoolByteArray()`. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#fromByteArray(byte[],int,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray, int offset, int length)` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` from the provided byte array at the provided offset and length, that was generated by one of the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#toDynamicBoolByteArray()` overloads. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#ne(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool other)` Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if the value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` and `other` are not equal, otherwise it's false. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#negate()()` Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that has the opposite value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool`. i.e. {code result = !this} |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#or(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool input)` Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` or `input` are true, otherwise it is false. i.e. `boolean result = this || input` |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[]` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#toDynamicBoolByteArray()()` Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` into a new byte array that can later be used with `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#fromByteArray(byte[])`. |
| `default int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#toDynamicBoolByteArray(byte[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray)` Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` into the provided byte array, returning the amount of bytes written, that can later be used with `DynamicBool.fromByteArray(byteArray, 0, bytesWritten)`. |
| `default int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#toDynamicBoolByteArray(byte[],int,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray, int offset, int length)` Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with `DynamicBool.fromByteArray(byteArray, offset, bytesWritten)`. |

## Public methods

### and

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicBool and(@NonNull DynamicBuilders.DynamicBool input)
```

Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` and `input` are both true, otherwise it is false. i.e. `boolean result = this && input`

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool input` | The right hand operand of the "and" operation. |

### constant

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicBool constant(boolean constant)
```

Creates a constant-valued `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool`.

### eq

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicBool eq(@NonNull DynamicBuilders.DynamicBool other)
```

Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if the value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` and `other` are equal, otherwise it's false.

### from

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicBool from(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicBool> dynamicDataKey
)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is bound to the value of an item of the State.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool> dynamicDataKey` | The key to a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataBuilders.DynamicDataValue` with a boolean value. |

### fromByteArray

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

```
default static @NonNull DynamicBuilders.DynamicBool fromByteArray(@NonNull byte[] byteArray)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` from a byte array generated by `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#toDynamicBoolByteArray()`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array does not contain a valid serialization |

### fromByteArray

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

```
default static @NonNull DynamicBuilders.DynamicBool fromByteArray(@NonNull byte[] byteArray, int offset, int length)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` from the provided byte array at the provided offset and length, that was generated by one of the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#toDynamicBoolByteArray()` overloads.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array does not contain a valid serialization in the provided offset and length |

### ne

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicBool ne(@NonNull DynamicBuilders.DynamicBool other)
```

Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if the value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` and `other` are not equal, otherwise it's false.

### negate

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicBool negate()
```

Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that has the opposite value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool`. i.e. {code result = !this}

### or

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicBool or(@NonNull DynamicBuilders.DynamicBool input)
```

Returns a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` that is true if this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` or `input` are true, otherwise it is false. i.e. `boolean result = this || input`

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool input` | The right hand operand of the "or" operation. |

### toDynamicBoolByteArray

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

```
default @NonNull byte[] toDynamicBoolByteArray()
```

Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` into a new byte array that can later be used with `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool#fromByteArray(byte[])`.

### toDynamicBoolByteArray

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

```
default int toDynamicBoolByteArray(@NonNull byte[] byteArray)
```

Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` into the provided byte array, returning the amount of bytes written, that can later be used with `DynamicBool.fromByteArray(byteArray, 0, bytesWritten)`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array is too small |

### toDynamicBoolByteArray

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

```
default int toDynamicBoolByteArray(@NonNull byte[] byteArray, int offset, int length)
```

Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool` into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with `DynamicBool.fromByteArray(byteArray, offset, bytesWritten)`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array is too small |