Share via


SetSchemaRequest Class

Definition

Encapsulates a request to update the schema of an AppSearchSession database.

[Android.Runtime.Register("android/app/appsearch/SetSchemaRequest", ApiSince=31, DoNotGenerateAcw=true)]
public sealed class SetSchemaRequest : Java.Lang.Object
[<Android.Runtime.Register("android/app/appsearch/SetSchemaRequest", ApiSince=31, DoNotGenerateAcw=true)>]
type SetSchemaRequest = class
    inherit Object
Inheritance
SetSchemaRequest
Attributes

Remarks

Encapsulates a request to update the schema of an AppSearchSession database.

The schema is composed of a collection of AppSearchSchema objects, each of which defines a unique type of data.

The first call to SetSchemaRequest will set the provided schema and store it within the AppSearchSession database.

Subsequent calls will compare the provided schema to the previously saved schema, to determine how to treat existing documents.

The following types of schema modifications are always safe and are made without deleting any existing documents:

<ul> <li>Addition of new AppSearchSchema types <li>Addition of new properties to an existing AppSearchSchema type <li>Changing the cardinality of a property to be less restrictive </ul>

The following types of schema changes are not backwards compatible:

<ul> <li>Removal of an existing AppSearchSchema type <li>Removal of a property from an existing AppSearchSchema type <li>Changing the data type of an existing property <li>Changing the cardinality of a property to be more restrictive </ul>

Providing a schema with incompatible changes, will throw an android.app.appsearch.exceptions.AppSearchException, with a message describing the incompatibility. As a result, the previously set schema will remain unchanged.

Backward incompatible changes can be made by :

<ul> <li>setting SetSchemaRequest.Builder#setForceOverride method to true. This deletes all documents that are incompatible with the new schema. The new schema is then saved and persisted to disk. <li>Add a Migrator for each incompatible type and make no deletion. The migrator will migrate documents from its old schema version to the new version. Migrated types will be set into both SetSchemaResponse#getIncompatibleTypes() and SetSchemaResponse#getMigratedTypes(). See the migration section below. </ul>

Java documentation for android.app.appsearch.SetSchemaRequest.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

ReadAssistantAppSearchData
Obsolete.

The android.Manifest.permission#READ_ASSISTANT_APP_SEARCH_DATA AppSearch supported in SetSchemaRequest.Builder#addRequiredPermissionsForSchemaTypeVisibility

ReadCalendar
Obsolete.

The android.Manifest.permission#READ_CALENDAR AppSearch supported in SetSchemaRequest.Builder#addRequiredPermissionsForSchemaTypeVisibility

ReadContacts
Obsolete.

The android.Manifest.permission#READ_CONTACTS AppSearch supported in SetSchemaRequest.Builder#addRequiredPermissionsForSchemaTypeVisibility

ReadExternalStorage
Obsolete.

The android.Manifest.permission#READ_EXTERNAL_STORAGE AppSearch supported in SetSchemaRequest.Builder#addRequiredPermissionsForSchemaTypeVisibility

ReadHomeAppSearchData
Obsolete.

The android.Manifest.permission#READ_HOME_APP_SEARCH_DATA AppSearch supported in SetSchemaRequest.Builder#addRequiredPermissionsForSchemaTypeVisibility

ReadSms
Obsolete.

The android.Manifest.permission#READ_SMS AppSearch supported in SetSchemaRequest.Builder#addRequiredPermissionsForSchemaTypeVisibility

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsForceOverride

Returns whether this request will force the schema to be overridden.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Migrators

Returns the map of Migrator, the key will be the schema type of the Migrator associated with.

PeerReference (Inherited from Object)
PubliclyVisibleSchemas

Returns a mapping of publicly visible schemas to the PackageIdentifier specifying the package the schemas are from.

RequiredPermissionsForSchemaTypeVisibility

Returns a mapping of schema types to the Map of android.Manifest.permission combinations that querier must hold to access that schema type.

Schemas

Returns the AppSearchSchema types that are part of this request.

SchemasNotDisplayedBySystem

Returns all the schema types that are opted out of being displayed and visible on any system UI surface.

SchemasVisibleToConfigs

Returns a mapping of schema types to the set of SchemaVisibilityConfig that have access to that schema type.

SchemasVisibleToPackages

Returns a mapping of schema types to the set of packages that have access to that schema type.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
Version

Returns the database overall schema version.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

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

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

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

(Inherited from Object)
Notify()

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

(Inherited from Object)
NotifyAll()

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

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

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

(Inherited from Object)
Wait(Int64, Int32)

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

(Inherited from Object)
Wait(Int64)

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

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to