SetSchemaResponse.MigrationFailure

public static class SetSchemaResponse.MigrationFailure
extends Object

java.lang.Object
   ↳ androidx.appsearch.app.SetSchemaResponse.MigrationFailure


The class represents a post-migrated GenericDocument that failed to be saved by AppSearchSession.setSchema(SetSchemaRequest).

Summary

Public constructors

MigrationFailure(String namespace, String documentId, String schemaType, AppSearchResult<?> failedResult)

Constructs a new SetSchemaResponse.MigrationFailure.

Public methods

AppSearchResult<Void> getAppSearchResult()

Returns the AppSearchResult that indicates why the post-migration GenericDocument failed to be indexed.

String getDocumentId()

Returns the id of the GenericDocument that failed to be migrated.

String getNamespace()

Returns the namespace of the GenericDocument that failed to be migrated.

String getSchemaType()

Returns the schema type of the GenericDocument that failed to be migrated.

Inherited methods

Public constructors

MigrationFailure

public MigrationFailure (String namespace, 
                String documentId, 
                String schemaType, 
                AppSearchResult<?> failedResult)

Constructs a new SetSchemaResponse.MigrationFailure.

Parameters
namespace String: The namespace of the document which failed to be migrated.

documentId String: The id of the document which failed to be migrated.

schemaType String: The type of the document which failed to be migrated.

failedResult AppSearchResult: The reason why the document failed to be indexed.

Throws
IllegalArgumentException if the provided failedResult was not a failure.

Public methods

getAppSearchResult

public AppSearchResult<Void> getAppSearchResult ()

Returns the AppSearchResult that indicates why the post-migration GenericDocument failed to be indexed.

Returns
AppSearchResult<Void>

getDocumentId

public String getDocumentId ()

Returns the id of the GenericDocument that failed to be migrated.

Returns
String

getNamespace

public String getNamespace ()

Returns the namespace of the GenericDocument that failed to be migrated.

Returns
String

getSchemaType

public String getSchemaType ()

Returns the schema type of the GenericDocument that failed to be migrated.

Returns
String