Class Index.Builder (3.21.3)

public static final class Index.Builder extends GeneratedMessageV3.Builder<Index.Builder> implements IndexOrBuilder

Cloud Firestore indexes enable simple and complex queries against documents in a database.

Protobuf type google.firestore.admin.v1.Index

Implements

IndexOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllFields(Iterable<? extends Index.IndexField> values)

public Index.Builder addAllFields(Iterable<? extends Index.IndexField> values)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
values Iterable<? extends com.google.firestore.admin.v1.Index.IndexField>
Returns
Type Description
Index.Builder

addFields(Index.IndexField value)

public Index.Builder addFields(Index.IndexField value)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
value Index.IndexField
Returns
Type Description
Index.Builder

addFields(Index.IndexField.Builder builderForValue)

public Index.Builder addFields(Index.IndexField.Builder builderForValue)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
builderForValue Index.IndexField.Builder
Returns
Type Description
Index.Builder

addFields(int index, Index.IndexField value)

public Index.Builder addFields(int index, Index.IndexField value)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameters
Name Description
index int
value Index.IndexField
Returns
Type Description
Index.Builder

addFields(int index, Index.IndexField.Builder builderForValue)

public Index.Builder addFields(int index, Index.IndexField.Builder builderForValue)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameters
Name Description
index int
builderForValue Index.IndexField.Builder
Returns
Type Description
Index.Builder

addFieldsBuilder()

public Index.IndexField.Builder addFieldsBuilder()

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Returns
Type Description
Index.IndexField.Builder

addFieldsBuilder(int index)

public Index.IndexField.Builder addFieldsBuilder(int index)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
index int
Returns
Type Description
Index.IndexField.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Index.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Index.Builder
Overrides

build()

public Index build()
Returns
Type Description
Index

buildPartial()

public Index buildPartial()
Returns
Type Description
Index

clear()

public Index.Builder clear()
Returns
Type Description
Index.Builder
Overrides

clearApiScope()

public Index.Builder clearApiScope()

The API scope supported by this index.

.google.firestore.admin.v1.Index.ApiScope api_scope = 5;

Returns
Type Description
Index.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Index.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Index.Builder
Overrides

clearFields()

public Index.Builder clearFields()

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Returns
Type Description
Index.Builder

clearName()

public Index.Builder clearName()

Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.

string name = 1;

Returns
Type Description
Index.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Index.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Index.Builder
Overrides

clearQueryScope()

public Index.Builder clearQueryScope()

Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id.

Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.

.google.firestore.admin.v1.Index.QueryScope query_scope = 2;

Returns
Type Description
Index.Builder

This builder for chaining.

clearState()

public Index.Builder clearState()

Output only. The serving state of the index.

.google.firestore.admin.v1.Index.State state = 4;

Returns
Type Description
Index.Builder

This builder for chaining.

clone()

public Index.Builder clone()
Returns
Type Description
Index.Builder
Overrides

getApiScope()

public Index.ApiScope getApiScope()

The API scope supported by this index.

.google.firestore.admin.v1.Index.ApiScope api_scope = 5;

Returns
Type Description
Index.ApiScope

The apiScope.

getApiScopeValue()

public int getApiScopeValue()

The API scope supported by this index.

.google.firestore.admin.v1.Index.ApiScope api_scope = 5;

Returns
Type Description
int

The enum numeric value on the wire for apiScope.

getDefaultInstanceForType()

public Index getDefaultInstanceForType()
Returns
Type Description
Index

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getFields(int index)

public Index.IndexField getFields(int index)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
index int
Returns
Type Description
Index.IndexField

getFieldsBuilder(int index)

public Index.IndexField.Builder getFieldsBuilder(int index)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
index int
Returns
Type Description
Index.IndexField.Builder

getFieldsBuilderList()

public List<Index.IndexField.Builder> getFieldsBuilderList()

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Returns
Type Description
List<Builder>

getFieldsCount()

public int getFieldsCount()

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Returns
Type Description
int

getFieldsList()

public List<Index.IndexField> getFieldsList()

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Returns
Type Description
List<IndexField>

getFieldsOrBuilder(int index)

public Index.IndexFieldOrBuilder getFieldsOrBuilder(int index)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
index int
Returns
Type Description
Index.IndexFieldOrBuilder

getFieldsOrBuilderList()

public List<? extends Index.IndexFieldOrBuilder> getFieldsOrBuilderList()

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Returns
Type Description
List<? extends com.google.firestore.admin.v1.Index.IndexFieldOrBuilder>

getName()

public String getName()

Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getQueryScope()

public Index.QueryScope getQueryScope()

Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id.

Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.

.google.firestore.admin.v1.Index.QueryScope query_scope = 2;

Returns
Type Description
Index.QueryScope

The queryScope.

getQueryScopeValue()

public int getQueryScopeValue()

Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id.

Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.

.google.firestore.admin.v1.Index.QueryScope query_scope = 2;

Returns
Type Description
int

The enum numeric value on the wire for queryScope.

getState()

public Index.State getState()

Output only. The serving state of the index.

.google.firestore.admin.v1.Index.State state = 4;

Returns
Type Description
Index.State

The state.

getStateValue()

public int getStateValue()

Output only. The serving state of the index.

.google.firestore.admin.v1.Index.State state = 4;

Returns
Type Description
int

The enum numeric value on the wire for state.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Index other)

public Index.Builder mergeFrom(Index other)
Parameter
Name Description
other Index
Returns
Type Description
Index.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Index.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Index.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Index.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Index.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Index.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Index.Builder
Overrides

removeFields(int index)

public Index.Builder removeFields(int index)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameter
Name Description
index int
Returns
Type Description
Index.Builder

setApiScope(Index.ApiScope value)

public Index.Builder setApiScope(Index.ApiScope value)

The API scope supported by this index.

.google.firestore.admin.v1.Index.ApiScope api_scope = 5;

Parameter
Name Description
value Index.ApiScope

The apiScope to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setApiScopeValue(int value)

public Index.Builder setApiScopeValue(int value)

The API scope supported by this index.

.google.firestore.admin.v1.Index.ApiScope api_scope = 5;

Parameter
Name Description
value int

The enum numeric value on the wire for apiScope to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Index.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Index.Builder
Overrides

setFields(int index, Index.IndexField value)

public Index.Builder setFields(int index, Index.IndexField value)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameters
Name Description
index int
value Index.IndexField
Returns
Type Description
Index.Builder

setFields(int index, Index.IndexField.Builder builderForValue)

public Index.Builder setFields(int index, Index.IndexField.Builder builderForValue)

The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path name. If, on creation, name was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the name will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

repeated .google.firestore.admin.v1.Index.IndexField fields = 3;

Parameters
Name Description
index int
builderForValue Index.IndexField.Builder
Returns
Type Description
Index.Builder

setName(String value)

public Index.Builder setName(String value)

Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Index.Builder setNameBytes(ByteString value)

Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setQueryScope(Index.QueryScope value)

public Index.Builder setQueryScope(Index.QueryScope value)

Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id.

Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.

.google.firestore.admin.v1.Index.QueryScope query_scope = 2;

Parameter
Name Description
value Index.QueryScope

The queryScope to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setQueryScopeValue(int value)

public Index.Builder setQueryScopeValue(int value)

Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id.

Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.

.google.firestore.admin.v1.Index.QueryScope query_scope = 2;

Parameter
Name Description
value int

The enum numeric value on the wire for queryScope to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Index.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Index.Builder
Overrides

setState(Index.State value)

public Index.Builder setState(Index.State value)

Output only. The serving state of the index.

.google.firestore.admin.v1.Index.State state = 4;

Parameter
Name Description
value Index.State

The state to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setStateValue(int value)

public Index.Builder setStateValue(int value)

Output only. The serving state of the index.

.google.firestore.admin.v1.Index.State state = 4;

Parameter
Name Description
value int

The enum numeric value on the wire for state to set.

Returns
Type Description
Index.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Index.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Index.Builder
Overrides