Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for ObserverSpec
instances.
Summary
Public methods |
ObserverSpec.Builder |
Restricts an observer using this spec to triggering only for documents of one of the provided schema types.
|
ObserverSpec.Builder |
Restricts an observer using this spec to triggering only for documents of one of the provided schema types.
|
ObserverSpec |
Constructs a new ObserverSpec from the contents of this builder.
|
Public constructors
Public methods
addFilterSchemas
fun addFilterSchemas(vararg schemas: String!): ObserverSpec.Builder
Restricts an observer using this spec to triggering only for documents of one of the provided schema types.
If unset, the observer will match documents of all types.
Parameters |
schemas |
String!: This value cannot be null . |
addFilterSchemas
fun addFilterSchemas(schemas: MutableCollection<String!>): ObserverSpec.Builder
Restricts an observer using this spec to triggering only for documents of one of the provided schema types.
If unset, the observer will match documents of all types.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ObserverSpec.Builder\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/appsearch/observer/ObserverSpec.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.appsearch.observer.ObserverSpec.Builder](#) |\n\nBuilder for [ObserverSpec](/reference/kotlin/android/app/appsearch/observer/ObserverSpec) instances.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ObserverSpec.Builder](#) | [addFilterSchemas](#addFilterSchemas(kotlin.String))`(`vararg` `schemas:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Restricts an observer using this spec to triggering only for documents of one of the provided schema types. |\n| [ObserverSpec.Builder](#) | [addFilterSchemas](#addFilterSchemas(kotlin.collections.MutableCollection))`(`schemas:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\u003e`)` Restricts an observer using this spec to triggering only for documents of one of the provided schema types. |\n| [ObserverSpec](/reference/kotlin/android/app/appsearch/observer/ObserverSpec) | [build](#build())`()` Constructs a new [ObserverSpec](/reference/kotlin/android/app/appsearch/observer/ObserverSpec) from the contents of this builder. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### addFilterSchemas\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nfun addFilterSchemas(vararg schemas: String!): ObserverSpec.Builder\n```\n\nRestricts an observer using this spec to triggering only for documents of one of the provided schema types.\n\nIf unset, the observer will match documents of all types.\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------------------------------------------|\n| `schemas` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: This value cannot be `null`. |\n\n| Return ||\n|---------------------------|------------------------------|\n| [ObserverSpec.Builder](#) | This value cannot be `null`. |\n\n### addFilterSchemas\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nfun addFilterSchemas(schemas: MutableCollection\u003cString!\u003e): ObserverSpec.Builder\n```\n\nRestricts an observer using this spec to triggering only for documents of one of the provided schema types.\n\nIf unset, the observer will match documents of all types.\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `schemas` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e: This value cannot be `null`. |\n\n| Return ||\n|---------------------------|------------------------------|\n| [ObserverSpec.Builder](#) | This value cannot be `null`. |\n\n### build\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nfun build(): ObserverSpec\n```\n\nConstructs a new [ObserverSpec](/reference/kotlin/android/app/appsearch/observer/ObserverSpec) from the contents of this builder.\n\n| Return ||\n|-------------------------------------------------------------------------------|------------------------------|\n| [ObserverSpec](/reference/kotlin/android/app/appsearch/observer/ObserverSpec) | This value cannot be `null`. |"]]