# PropertyRestrictNode

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/PropertyRestrictNode.java+class:androidx.appsearch.ast.operators.PropertyRestrictNode) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
@ExperimentalAppSearchApi
class PropertyRestrictNode : Node
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` that represents a property restrict.

A property restrict is an expression in the query language that allows a querier to restrict the results of a query expression to those contained in a given property path. Written as a query string, this node should be equivalent to the query \`property:child\`, where \`property\` is the property path to restrict results to and \`child\` is the query subexpression.

This node is a comparator that should correspond with HAS in the [Google AIP EBNF Filtering Definition](https://google.aip.dev/assets/misc/ebnf-filtering.txt).

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#PropertyRestrictNode(androidx.appsearch.app.PropertyPath,androidx.appsearch.ast.Node)(propertyPath: https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath, childNode: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node)` Constructor for building a `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode` that represents a restriction on a query subexpression by some property i.e. the query \`property:subexpression\`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#getChild()()` Get the subexpression in the property restriction as a `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` (i.e. the right hand side of the property restrict sign (":")). |
| `(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/PropertyRestrictNode#getChildren()()` Get the child `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode` as a list containing the only child `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node`. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#getPropertyPath()()` Get the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` in the property restriction (i.e. the left hand side of the property restrict sign (":")). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#setChild(androidx.appsearch.ast.Node)(childNode: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node)` Set the query subexpression in the property restriction (i.e. the right hand side of the property restrict sign (":")). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#setPropertyPath(androidx.appsearch.app.PropertyPath)(propertyPath: https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath)` Set the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` in the property restriction (i.e. the left hand side of the property restrict sign (":")). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode#toString()()` Get the query string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode`. |

## Public constructors

### PropertyRestrictNode

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

```
PropertyRestrictNode(propertyPath: PropertyPath, childNode: Node)
```

Constructor for building a `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode` that represents a restriction on a query subexpression by some property i.e. the query \`property:subexpression\`.

| Parameters |
|---|---|
| `propertyPath: https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` | The property that will restrict results returned by the subexpression in the property restrict |
| `childNode: https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` | The subexpression to be restricted in the property restrict |

## Public functions

### equals

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

### getChild

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

```
fun getChild(): Node
```

Get the subexpression in the property restriction as a `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` (i.e. the right hand side of the property restrict sign (":")).

### getChildren

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

Get the child `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node` of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode` as a list containing the only child `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node`.

### getPropertyPath

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

```
fun getPropertyPath(): PropertyPath
```

Get the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` in the property restriction (i.e. the left hand side of the property restrict sign (":")).

### hashCode

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

### setChild

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

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

Set the query subexpression in the property restriction (i.e. the right hand side of the property restrict sign (":")).

### setPropertyPath

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

```
fun setPropertyPath(propertyPath: PropertyPath): Unit
```

Set the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` in the property restriction (i.e. the left hand side of the property restrict sign (":")).

### toString

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

Get the query string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/operators/PropertyRestrictNode`.

The string representation is the string representation of the property path joined from the left to the query sub expression surrounded in parentheses with the property restrict symbol (":").