# BinaryOpNode.BinaryOp

Artifact: [androidx.ink:ink-brush](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/brush/behavior/BinaryOpNode.kt+class:androidx.ink.brush.behavior.BinaryOpNode.BinaryOp) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

*** ** * ** ***


```
public final class BinaryOpNode.BinaryOp
```

<br />

*** ** * ** ***

A binary operation for combining two values in a `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode`. Unless otherwise specified for a particular operator, the result will be null (i.e. undefined) if either input value is null.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#AND_THEN()` Evaluates to null if the first input is null, otherwise evaluates to the second input. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#MAX()` Evaluates to the max of the two input values. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#MIN()` Evaluates to the min of the two input values. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#OR_ELSE()` Evaluates to first input if it's not null, otherwise evaluates to the second input. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#PRODUCT()` Evaluates to the product of the two input values. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#SUM()` Evaluates to the sum of the two input values. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#XOR_ELSE()` If exactly one input isn't null, evaluates to that one, otherwise evaluates to null. |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/Version` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#calculateMinimumRequiredVersion()()` Returns the minimum required `https://developer.android.com/reference/androidx/ink/brush/Version` for this `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#toString()()` |

## Public fields

### AND_THEN

```
public static final @NonNull BinaryOpNode.BinaryOp AND_THEN
```

Evaluates to null if the first input is null, otherwise evaluates to the second input.

### MAX

```
public static final @NonNull BinaryOpNode.BinaryOp MAX
```

Evaluates to the max of the two input values.

### MIN

```
public static final @NonNull BinaryOpNode.BinaryOp MIN
```

Evaluates to the min of the two input values.

### OR_ELSE

```
public static final @NonNull BinaryOpNode.BinaryOp OR_ELSE
```

Evaluates to first input if it's not null, otherwise evaluates to the second input.

### PRODUCT

```
public static final @NonNull BinaryOpNode.BinaryOp PRODUCT
```

Evaluates to the product of the two input values.

### SUM

```
public static final @NonNull BinaryOpNode.BinaryOp SUM
```

Evaluates to the sum of the two input values.

### XOR_ELSE

```
public static final @NonNull BinaryOpNode.BinaryOp XOR_ELSE
```

If exactly one input isn't null, evaluates to that one, otherwise evaluates to null.

## Public methods

### calculateMinimumRequiredVersion

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public final @NonNull Version calculateMinimumRequiredVersion()
```

Returns the minimum required `https://developer.android.com/reference/androidx/ink/brush/Version` for this `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp`.

By default, decoding a `https://developer.android.com/reference/androidx/ink/brush/BrushFamily` containing a `https://developer.android.com/reference/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` with a minimum required version higher than `https://developer.android.com/reference/androidx/ink/brush/Version#MAX_SUPPORTED()` will fail.

### toString

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