Class Field.Builder (3.22.0)

public static final class Field.Builder extends GeneratedMessageV3.Builder<Field.Builder> implements FieldOrBuilder

Represents a single field in the database.

Fields are grouped by their "Collection Group", which represent all collections in the database with the same id.

Protobuf type google.firestore.admin.v1.Field

Implements

FieldOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Field build()
Returns
Type Description
Field

buildPartial()

public Field buildPartial()
Returns
Type Description
Field

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearIndexConfig()

public Field.Builder clearIndexConfig()

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Returns
Type Description
Field.Builder

clearName()

public Field.Builder clearName()

Required. A field name of the form: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}

A field path can be a simple field name, e.g. address or a path to fields within map_value , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.

Field paths can be quoted using (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: *, ., (backtick), [, ], as well as any ascii symbolic characters.

Examples: address.city represents a field named address.city, not the map key city in the field address. represents a field named , not any field.

A special Field contains the default indexing settings for all fields. This field's resource name is: projects/{project_id}/databases/{database_id}/collectionGroups/default/fields/* Indexes defined on this Field will be applied to all fields which do not have their own Field index configuration.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Field.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearTtlConfig()

public Field.Builder clearTtlConfig()

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Returns
Type Description
Field.Builder

clone()

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

getDefaultInstanceForType()

public Field getDefaultInstanceForType()
Returns
Type Description
Field

getDescriptorForType()

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

getIndexConfig()

public Field.IndexConfig getIndexConfig()

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Returns
Type Description
Field.IndexConfig

The indexConfig.

getIndexConfigBuilder()

public Field.IndexConfig.Builder getIndexConfigBuilder()

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Returns
Type Description
Field.IndexConfig.Builder

getIndexConfigOrBuilder()

public Field.IndexConfigOrBuilder getIndexConfigOrBuilder()

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Returns
Type Description
Field.IndexConfigOrBuilder

getName()

public String getName()

Required. A field name of the form: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}

A field path can be a simple field name, e.g. address or a path to fields within map_value , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.

Field paths can be quoted using (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: *, ., (backtick), [, ], as well as any ascii symbolic characters.

Examples: address.city represents a field named address.city, not the map key city in the field address. represents a field named , not any field.

A special Field contains the default indexing settings for all fields. This field's resource name is: projects/{project_id}/databases/{database_id}/collectionGroups/default/fields/* Indexes defined on this Field will be applied to all fields which do not have their own Field index configuration.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Required. A field name of the form: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}

A field path can be a simple field name, e.g. address or a path to fields within map_value , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.

Field paths can be quoted using (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: *, ., (backtick), [, ], as well as any ascii symbolic characters.

Examples: address.city represents a field named address.city, not the map key city in the field address. represents a field named , not any field.

A special Field contains the default indexing settings for all fields. This field's resource name is: projects/{project_id}/databases/{database_id}/collectionGroups/default/fields/* Indexes defined on this Field will be applied to all fields which do not have their own Field index configuration.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for name.

getTtlConfig()

public Field.TtlConfig getTtlConfig()

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Returns
Type Description
Field.TtlConfig

The ttlConfig.

getTtlConfigBuilder()

public Field.TtlConfig.Builder getTtlConfigBuilder()

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Returns
Type Description
Field.TtlConfig.Builder

getTtlConfigOrBuilder()

public Field.TtlConfigOrBuilder getTtlConfigOrBuilder()

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Returns
Type Description
Field.TtlConfigOrBuilder

hasIndexConfig()

public boolean hasIndexConfig()

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Returns
Type Description
boolean

Whether the indexConfig field is set.

hasTtlConfig()

public boolean hasTtlConfig()

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Returns
Type Description
boolean

Whether the ttlConfig field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Field other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeIndexConfig(Field.IndexConfig value)

public Field.Builder mergeIndexConfig(Field.IndexConfig value)

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Parameter
Name Description
value Field.IndexConfig
Returns
Type Description
Field.Builder

mergeTtlConfig(Field.TtlConfig value)

public Field.Builder mergeTtlConfig(Field.TtlConfig value)

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Parameter
Name Description
value Field.TtlConfig
Returns
Type Description
Field.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setIndexConfig(Field.IndexConfig value)

public Field.Builder setIndexConfig(Field.IndexConfig value)

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Parameter
Name Description
value Field.IndexConfig
Returns
Type Description
Field.Builder

setIndexConfig(Field.IndexConfig.Builder builderForValue)

public Field.Builder setIndexConfig(Field.IndexConfig.Builder builderForValue)

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

.google.firestore.admin.v1.Field.IndexConfig index_config = 2;

Parameter
Name Description
builderForValue Field.IndexConfig.Builder
Returns
Type Description
Field.Builder

setName(String value)

public Field.Builder setName(String value)

Required. A field name of the form: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}

A field path can be a simple field name, e.g. address or a path to fields within map_value , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.

Field paths can be quoted using (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: *, ., (backtick), [, ], as well as any ascii symbolic characters.

Examples: address.city represents a field named address.city, not the map key city in the field address. represents a field named , not any field.

A special Field contains the default indexing settings for all fields. This field's resource name is: projects/{project_id}/databases/{database_id}/collectionGroups/default/fields/* Indexes defined on this Field will be applied to all fields which do not have their own Field index configuration.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Field.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Field.Builder setNameBytes(ByteString value)

Required. A field name of the form: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}

A field path can be a simple field name, e.g. address or a path to fields within map_value , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.

Field paths can be quoted using (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: *, ., (backtick), [, ], as well as any ascii symbolic characters.

Examples: address.city represents a field named address.city, not the map key city in the field address. represents a field named , not any field.

A special Field contains the default indexing settings for all fields. This field's resource name is: projects/{project_id}/databases/{database_id}/collectionGroups/default/fields/* Indexes defined on this Field will be applied to all fields which do not have their own Field index configuration.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Field.Builder

This builder for chaining.

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

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

setTtlConfig(Field.TtlConfig value)

public Field.Builder setTtlConfig(Field.TtlConfig value)

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Parameter
Name Description
value Field.TtlConfig
Returns
Type Description
Field.Builder

setTtlConfig(Field.TtlConfig.Builder builderForValue)

public Field.Builder setTtlConfig(Field.TtlConfig.Builder builderForValue)

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

.google.firestore.admin.v1.Field.TtlConfig ttl_config = 3;

Parameter
Name Description
builderForValue Field.TtlConfig.Builder
Returns
Type Description
Field.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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