# 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
public final class HasPropertyNode implements FunctionNode
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/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/androidx/appsearch/ast/query/HasPropertyNode#HasPropertyNode(androidx.appsearch.app.PropertyPath)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/PropertyPath propertyPath)` Constructor for a `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode` representing the query function \`hasProperty\`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html o)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode#getFunctionName()()` Returns the name of the function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode`, stored in the enum `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_HAS_PROPERTY()`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/PropertyPath` | `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode#getPropertyPath()()` Gets the `https://developer.android.com/reference/androidx/appsearch/app/PropertyPath` representing the property being checked for some value in the document. |
| `int` | `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode#hashCode()()` |
| `void` | `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode#setPropertyPath(androidx.appsearch.app.PropertyPath)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/PropertyPath property)` Sets the `https://developer.android.com/reference/androidx/appsearch/app/PropertyPath` representing the property being checked for some value in the document. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode#toString()()` Get the string representation of `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode`. |

| ### Inherited Constants |
|---|
| From [androidx.appsearch.ast.FunctionNode](https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode) |---|---| | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_GET_SEARCH_STRING_PARAMETER() = "getSearchStringParameter"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_HAS_PROPERTY() = "hasProperty"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_PROPERTY_DEFINED() = "propertyDefined"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/PropertyDefinedNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_SEARCH() = "search"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/SearchNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_SEMANTIC_SEARCH() = "semanticSearch"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/SemanticSearchNode`. | |

| ### Inherited methods |
|---|
| From [androidx.appsearch.ast.Node](https://developer.android.com/reference/androidx/appsearch/ast/Node) |---|---| | `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/ast/Node>` | `https://developer.android.com/reference/androidx/appsearch/ast/Node#getChildren()()` Get a list of the node's child `https://developer.android.com/reference/androidx/appsearch/ast/Node`s. | |

## Public constructors

### HasPropertyNode

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

```
public HasPropertyNode(@NonNull PropertyPath propertyPath)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/PropertyPath propertyPath` | A `https://developer.android.com/reference/androidx/appsearch/app/PropertyPath` representing the property to check whether or not it contains a value in the document. |

## Public methods

### equals

```
public boolean equals(Object o)
```

### getFunctionName

```
public @NonNull String getFunctionName()
```

Returns the name of the function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode`, stored in the enum `https://developer.android.com/reference/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)

```
public @NonNull PropertyPath getPropertyPath()
```

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

### hashCode

```
public int hashCode()
```

### setPropertyPath

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

```
public void setPropertyPath(@NonNull PropertyPath property)
```

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

### toString

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

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

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