Class Index.Builder (3.4.1)

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
TypeDescription
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 is always 2 or more 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
NameDescription
valuesIterable<? extends com.google.firestore.admin.v1.Index.IndexField>
Returns
TypeDescription
Index.Builder

addFields(Index.IndexField value)

public Index.Builder addFields(Index.IndexField value)

The fields supported by this index. For composite indexes, this is always 2 or more 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
NameDescription
valueIndex.IndexField
Returns
TypeDescription
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 is always 2 or more 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
NameDescription
builderForValueIndex.IndexField.Builder
Returns
TypeDescription
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 is always 2 or more 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
NameDescription
indexint
valueIndex.IndexField
Returns
TypeDescription
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 is always 2 or more 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
NameDescription
indexint
builderForValueIndex.IndexField.Builder
Returns
TypeDescription
Index.Builder

addFieldsBuilder()

public Index.IndexField.Builder addFieldsBuilder()

The fields supported by this index. For composite indexes, this is always 2 or more 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
TypeDescription
Index.IndexField.Builder

addFieldsBuilder(int index)

public Index.IndexField.Builder addFieldsBuilder(int index)

The fields supported by this index. For composite indexes, this is always 2 or more 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
NameDescription
indexint
Returns
TypeDescription
Index.IndexField.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Index.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Index.Builder
Overrides

build()

public Index build()
Returns
TypeDescription
Index

buildPartial()

public Index buildPartial()
Returns
TypeDescription
Index

clear()

public Index.Builder clear()
Returns
TypeDescription
Index.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Index.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Index.Builder
Overrides

clearFields()

public Index.Builder clearFields()

The fields supported by this index. For composite indexes, this is always 2 or more 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
TypeDescription
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
TypeDescription
Index.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Index.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Index.Builder

This builder for chaining.

clone()

public Index.Builder clone()
Returns
TypeDescription
Index.Builder
Overrides

getDefaultInstanceForType()

public Index getDefaultInstanceForType()
Returns
TypeDescription
Index

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFields(int index)

public Index.IndexField getFields(int index)

The fields supported by this index. For composite indexes, this is always 2 or more 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
NameDescription
indexint
Returns
TypeDescription
Index.IndexField

getFieldsBuilder(int index)

public Index.IndexField.Builder getFieldsBuilder(int index)

The fields supported by this index. For composite indexes, this is always 2 or more 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
NameDescription
indexint
Returns
TypeDescription
Index.IndexField.Builder

getFieldsBuilderList()

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

The fields supported by this index. For composite indexes, this is always 2 or more 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
TypeDescription
List<Builder>

getFieldsCount()

public int getFieldsCount()

The fields supported by this index. For composite indexes, this is always 2 or more 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
TypeDescription
int

getFieldsList()

public List<Index.IndexField> getFieldsList()

The fields supported by this index. For composite indexes, this is always 2 or more 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
TypeDescription
List<IndexField>

getFieldsOrBuilder(int index)

public Index.IndexFieldOrBuilder getFieldsOrBuilder(int index)

The fields supported by this index. For composite indexes, this is always 2 or more 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
NameDescription
indexint
Returns
TypeDescription
Index.IndexFieldOrBuilder

getFieldsOrBuilderList()

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

The fields supported by this index. For composite indexes, this is always 2 or more 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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
int

The enum numeric value on the wire for state.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Index other)

public Index.Builder mergeFrom(Index other)
Parameter
NameDescription
otherIndex
Returns
TypeDescription
Index.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Index.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Index.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Index.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Index.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Index.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Index.Builder
Overrides

removeFields(int index)

public Index.Builder removeFields(int index)

The fields supported by this index. For composite indexes, this is always 2 or more 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
NameDescription
indexint
Returns
TypeDescription
Index.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Index.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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 is always 2 or more 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
NameDescription
indexint
valueIndex.IndexField
Returns
TypeDescription
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 is always 2 or more 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
NameDescription
indexint
builderForValueIndex.IndexField.Builder
Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
valueIndex.QueryScope

The queryScope to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueIndex.State

The state to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
Index.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Index.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Index.Builder
Overrides