# SetBlobVisibilityRequest.Builder

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

*** ** * ** ***


```
public final class SetBlobVisibilityRequest.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder#addNamespaceVisibleToConfig(java.lang.String,androidx.appsearch.app.SchemaVisibilityConfig)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig visibilityConfig )` Specifies that blobs within the given `namespace` can be accessed by the caller if they meet the requirements defined in `https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest` | `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder#build()()` Builds a new `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest` object. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder#clearNamespaceVisibleToConfigs(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace)` Clears all visibility configurations for the specified blob `namespace`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest.Builder#setNamespaceDisplayedBySystem(java.lang.String,boolean)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace, boolean displayed )` Sets whether or not blobs in the specified `namespace` will be displayed on any system UI surface. |

## Public constructors

### Builder

Added in 1.1.0

```
public Builder()
```

## Public methods

### addNamespaceVisibleToConfig

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

```
public @NonNull SetBlobVisibilityRequest.Builder addNamespaceVisibleToConfig(
    @NonNull String namespace,
    @NonNull SchemaVisibilityConfig visibilityConfig
)
```

Specifies that blobs within the given `namespace` can be accessed by the caller if they meet the requirements defined in `https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig`.

The requirements in each `https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig` have an "AND" relationship, meaning that all conditions within a configuration must be met for access. For instance, the caller may need specific permissions and belong to a specific package.

Repeated calls to this method can add multiple `https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig`s to a namespace. The caller will have access if they match any of the configurations added, so the configurations form an "OR" relationship.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | The blob namespace to set visibility for. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig visibilityConfig` | The config hold specifying visibility settings. |

### build

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

```
public @NonNull SetBlobVisibilityRequest build()
```

Builds a new `https://developer.android.com/reference/androidx/appsearch/app/SetBlobVisibilityRequest` object.

### clearNamespaceVisibleToConfigs

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

```
public @NonNull SetBlobVisibilityRequest.Builder clearNamespaceVisibleToConfigs(@NonNull String namespace)
```

Clears all visibility configurations for the specified blob `namespace`.

After calling this method, the specified namespace will have no visibility configurations, meaning it will only be accessible by default rules.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | The blob namespace for which visibility config should be cleared. |

### setNamespaceDisplayedBySystem

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

```
public @NonNull SetBlobVisibilityRequest.Builder setNamespaceDisplayedBySystem(
    @NonNull String namespace,
    boolean displayed
)
```

Sets whether or not blobs in the specified `namespace` will be displayed on any system UI surface.

This setting applies to the provided `namespace` only, all other `namespace`s that are not included here will be reverted to the default displayed setting.

If this method is not called, the default behavior allows blobs to be displayed on system UI surfaces.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | The name of the namespace to configure visibility for. |
| `boolean displayed` | If `false`, blobs in this namespace will not appear on system UI surfaces. |