# HasPropertyNode

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

*** ** * ** ***


```
@ExperimentalAppSearchApi
class HasPropertyNode : FunctionNode
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode` representing the \`hasProperty\` query function.

The \`hasProperty\` query function will return all documents that contain the given property and have values in the given property.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode#HasPropertyNode(androidx.appsearch.app.PropertyPath)(propertyPath: https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath)` Constructor for a `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode` representing the query function \`hasProperty\`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode#getFunctionName()()` Returns the name of the function represented by `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode`, stored in the enum `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_HAS_PROPERTY()`. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode#getPropertyPath()()` Gets the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` representing the property being checked for some value in the document. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode#setPropertyPath(androidx.appsearch.app.PropertyPath)(property: https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath)` Sets the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` representing the property being checked for some value in the document. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode#toString()()` Get the string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode`. |

| ### Inherited Constants |
|---|
| From [androidx.appsearch.ast.FunctionNode](https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_GET_SEARCH_STRING_PARAMETER() = "getSearchStringParameter"` Name of the query function represented by `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/GetSearchStringParameterNode`. | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_HAS_PROPERTY() = "hasProperty"` Name of the query function represented by `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode`. | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_PROPERTY_DEFINED() = "propertyDefined"` Name of the query function represented by `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/PropertyDefinedNode`. | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_SEARCH() = "search"` Name of the query function represented by `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/SearchNode`. | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_SEMANTIC_SEARCH() = "semanticSearch"` Name of the query function represented by `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/SemanticSearchNode`. | |

| ### Inherited functions |
|---|
| From [androidx.appsearch.ast.Node](https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node) |---|---| | `(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/Node#getChildren()()` Get a list of the node's child `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/Node`s. | |

## Public constructors

### HasPropertyNode

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

```
HasPropertyNode(propertyPath: PropertyPath)
```

Constructor for a `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode` representing the query function \`hasProperty\`.

| Parameters |
|---|---|
| `propertyPath: https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` | A `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` representing the property to check whether or not it contains a value in the document. |

## Public functions

### equals

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

### getFunctionName

```
fun getFunctionName(): String
```

Returns the name of the function represented by `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode`, stored in the enum `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_HAS_PROPERTY()`.

### getPropertyPath

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

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

Gets the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` representing the property being checked for some value in the document.

### hashCode

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

### setPropertyPath

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

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

Sets the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` representing the property being checked for some value in the document.

### toString

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

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

The string representation of `https://developer.android.com/reference/kotlin/androidx/appsearch/ast/query/HasPropertyNode` is the function name followed by the property path in quotes.