SetBlobVisibilityRequest.Builder


public static final class SetBlobVisibilityRequest.Builder
extends Object

java.lang.Object
   ↳ android.app.appsearch.SetBlobVisibilityRequest.Builder


Builder for SetBlobVisibilityRequest objects.

Summary

Public constructors

Builder()

Public methods

SetBlobVisibilityRequest.Builder addNamespaceVisibleToConfig(String namespace, SchemaVisibilityConfig visibilityConfig)

Specifies that blobs within the given namespace can be accessed by the caller if they meet the requirements defined in SchemaVisibilityConfig.

SetBlobVisibilityRequest build()

Builds a new SetBlobVisibilityRequest object.

SetBlobVisibilityRequest.Builder clearNamespaceVisibleToConfigs(String namespace)

Clears all visibility configurations for the specified blob namespace.

SetBlobVisibilityRequest.Builder setNamespaceDisplayedBySystem(String namespace, boolean displayed)

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

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

public Builder ()

Public methods

addNamespaceVisibleToConfig

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

Specifies that blobs within the given namespace can be accessed by the caller if they meet the requirements defined in SchemaVisibilityConfig.

The requirements in each 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 SchemaVisibilityConfigs to a namespace. The caller will have access if they match any of the configurations added, so the configurations form an "OR" relationship.

Parameters
namespace String: The blob namespace to set visibility for. This value cannot be null.

visibilityConfig SchemaVisibilityConfig: The config hold specifying visibility settings. This value cannot be null.

Returns
SetBlobVisibilityRequest.Builder This value cannot be null.

build

public SetBlobVisibilityRequest build ()

Builds a new SetBlobVisibilityRequest object.

Returns
SetBlobVisibilityRequest This value cannot be null.

clearNamespaceVisibleToConfigs

public SetBlobVisibilityRequest.Builder clearNamespaceVisibleToConfigs (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
namespace String: The blob namespace for which visibility config should be cleared. This value cannot be null.

Returns
SetBlobVisibilityRequest.Builder This value cannot be null.

setNamespaceDisplayedBySystem

public SetBlobVisibilityRequest.Builder setNamespaceDisplayedBySystem (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 namespaces 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
namespace String: The name of the namespace to configure visibility for. This value cannot be null.

displayed boolean: If false, blobs in this namespace will not appear on system UI surfaces.

Returns
SetBlobVisibilityRequest.Builder This value cannot be null.