# OrNode

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/ast/operators/OrNode.java+class:androidx.appsearch.ast.operators.OrNode) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
@ExperimentalAppSearchApi
class OrNode : Node
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` that represents logical OR of nodes.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#OrNode(java.util.List<androidx.appsearch.ast.Node>)(childNodes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node!>)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode` that represents logical OR over all its child nodes. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#OrNode(androidx.appsearch.ast.Node,androidx.appsearch.ast.Node,androidx.appsearch.ast.Node...)( firstChild: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node, secondChild: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node, additionalChildren: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node!> )` Convenience constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode` that represents logical OR over all its child nodes and takes in a varargs of nodes. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#addChild(androidx.appsearch.ast.Node)(childNode: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node)` Add a child node to the end of the current list of child nodes `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#mChildren()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#getChildren()()` Get the list of nodes being logically ORed over by this node. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#getIndexOfChild(androidx.appsearch.ast.Node)(node: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node)` Returns the index of the first instance of the node, or -1 if the node does not exist. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#removeChild(androidx.appsearch.ast.Node)(node: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node)` Removes the given `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` from the list of child nodes. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#setChild(int,androidx.appsearch.ast.Node)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, childNode: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node)` Replace the child node at the provided index with the provided `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#setChildren(java.util.List<androidx.appsearch.ast.Node>)(childNodes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node!>)` Set the nodes being logically ORed over by this node. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#toString()()` Gets the string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode`. |

## Public constructors

### OrNode

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

```
OrNode(childNodes: (Mutable)List<Node!>)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode` that represents logical OR over all its child nodes.

| Parameters |
|---|---|
| `childNodes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node!>` | The nodes representing queries to be logically ORed over. |

### OrNode

```
OrNode(
    firstChild: Node,
    secondChild: Node,
    additionalChildren: Array<Node!>
)
```

Convenience constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode` that represents logical OR over all its child nodes and takes in a varargs of nodes.

| Parameters |
|---|---|
| `firstChild: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` | The first node to be ORed over, which is required. |
| `secondChild: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` | The second node to be ORed over, which is required. |
| `additionalChildren: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node!>` | Additional nodes to be ORed over, which are optional. |

## Public functions

### addChild

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

```
fun addChild(childNode: Node): Unit
```

Add a child node to the end of the current list of child nodes `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#mChildren()`.

| Parameters |
|---|---|
| `childNode: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` | A `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` to add to the end of the list of child nodes. |

### equals

```
fun equals(o: Any!): Boolean
```

### getChildren

```
fun getChildren(): (Mutable)List<Node!>
```

Get the list of nodes being logically ORed over by this node.

### getIndexOfChild

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

```
fun getIndexOfChild(node: Node): Int
```

Returns the index of the first instance of the node, or -1 if the node does not exist.

### hashCode

```
fun hashCode(): Int
```

### removeChild

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

```
fun removeChild(node: Node): Boolean
```

Removes the given `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` from the list of child nodes. If multiple copies of the node exist, then the first `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` that matches the provided `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` will be removed. If the node does not exist, the list will be unchanged.

The list of child nodes must contain at least 3 nodes to perform this operation.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the node was removed, `false` if the node was not removed i.e. the node was not found. |

### setChild

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

```
fun setChild(index: Int, childNode: Node): Unit
```

Replace the child node at the provided index with the provided `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node`.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index at which to replace the child node in the list of child nodes. Must be in range of the size of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode#mChildren()`. |
| `childNode: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` | The `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` that is replacing the childNode at the provided index. |

### setChildren

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

```
fun setChildren(childNodes: (Mutable)List<Node!>): Unit
```

Set the nodes being logically ORed over by this node.

| Parameters |
|---|---|
| `childNodes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node!>` | A list of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` representing the nodes to be logically ORed over in this node. |

### toString

```
fun toString(): String
```

Gets the string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode`.

The string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode` is the string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/OrNode`'s child nodes joined with "OR", all surrounded by parentheses.