public @interface

Document.BuilderProducer

implements java.lang.annotation.Annotation

 androidx.appsearch.annotation.Document.BuilderProducer

Overview

Marks a static method or a builder class directly as a builder producer. A builder class should contain a "build()" method to construct the AppSearch document object and setter methods to set field values.

When a static method is marked as a builder producer, the method should return a builder instance for AppSearch to construct the document object. When a builder class is marked as a builder producer directly, AppSearch will use the constructor of the builder class to create a builder instance.

The annotated static method or the constructor of the annotated builder class is allowed to accept parameters to set a part of field values. In this case, AppSearch will only use setters to set values for the remaining fields.

Once a builder producer is specified, AppSearch will be forced to use the builder pattern to construct the document object.

Summary