# Print output for @column tags ?> SetSchemaResponse.MigrationFailure - Android SDK | Android Developers

Most visited

Recently visited

SetSchemaResponse.MigrationFailure

public static class SetSchemaResponse.MigrationFailure
extends Object

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


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

Summary

Public constructors

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

Constructs a new 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.

String toString()

Returns a string representation of the object.

Inherited methods

Public constructors

MigrationFailure

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

Constructs a new MigrationFailure.

Parameters
namespace String: The namespace of the document which failed to be migrated. This value cannot be null.

documentId String: The id of the document which failed to be migrated. This value cannot be null.

schemaType String: The type of the document which failed to be migrated. This value cannot be null.

failedResult AppSearchResult: The reason why the document failed to be indexed. This value cannot be null.

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> This value cannot be null.

getDocumentId

public String getDocumentId ()

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

Returns
String This value cannot be null.

getNamespace

public String getNamespace ()

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

Returns
String This value cannot be null.

getSchemaType

public String getSchemaType ()

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

Returns
String This value cannot be null.

toString

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String This value cannot be null.