# Enum Index.Density (3.43.1)

3.43.1 (latest) 3.41.0 3.38.0 3.37.0 3.36.0 3.35.1 3.33.4 3.32.2 3.31.9 3.30.11 3.28.0 3.27.2 3.26.5 3.25.1 3.24.3 3.22.0 3.21.4 3.20.0 3.17.0 3.16.3 3.15.7 3.14.4 3.13.2 3.12.1 3.11.0 3.10.0 3.9.6 3.8.2 3.7.10 3.6.0 3.5.0 3.4.2 3.3.0 3.2.0 3.1.0 3.0.21

    public enum Index.Density extends Enum<Index.Density> implements ProtocolMessageEnum

The density configuration for the index.

Protobuf enum `google.firestore.admin.v1.Index.Density`

## Implements

[ProtocolMessageEnum](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ProtocolMessageEnum.html)

## Inherited Members

[Enum.\<T\>valueOf(Class\<T\>,String)](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf-java.lang.Class-java.lang.String-) [Enum.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#clone--) [Enum.compareTo(E)](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo-E-) [Enum.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals-java.lang.Object-) [Enum.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#finalize--) [Enum.getDeclaringClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass--) [Enum.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode--) [Enum.name()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name--) [Enum.ordinal()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal--) [Enum.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

| ## Static Fields ||
|---|---|
| **Name** | **Description** |
| `DENSE` | An index entry will exist regardless of if the fields are present or not. This is the default density for an Enterprise Edition database. The index will store `unset` values for fields that are not present in the document. `DENSE = 3;` |
| `DENSE_VALUE` | An index entry will exist regardless of if the fields are present or not. This is the default density for an Enterprise Edition database. The index will store `unset` values for fields that are not present in the document. `DENSE = 3;` |
| `DENSITY_UNSPECIFIED` | Unspecified. It will use database default setting. This value is input only. `DENSITY_UNSPECIFIED = 0;` |
| `DENSITY_UNSPECIFIED_VALUE` | Unspecified. It will use database default setting. This value is input only. `DENSITY_UNSPECIFIED = 0;` |
| `SPARSE_ALL` | An index entry will only exist if ALL fields are present in the document. This is both the default and only allowed value for Standard Edition databases (for both Cloud Firestore `ANY_API` and Cloud Datastore `DATASTORE_MODE_API`). Take for example the following document: \``` ` { "name": "...", "a": 1, "b": 2, "c": 3 } ` `` ` ` ` an index on `(a ASC, b ASC, c ASC, **name** ASC)` will generate an index entry for this document since `a`, 'b', `c`, and `**name** ` are all present but an index of `(a ASC, d ASC, **name** ASC)` will not generate an index entry for this document since `d\` is missing. This means that such indexes can only be used to serve a query when the query has either implicit or explicit requirements that all fields from the index are present. `SPARSE_ALL = 1;` |
| `SPARSE_ALL_VALUE` | An index entry will only exist if ALL fields are present in the document. This is both the default and only allowed value for Standard Edition databases (for both Cloud Firestore `ANY_API` and Cloud Datastore `DATASTORE_MODE_API`). Take for example the following document: \``` ` { "name": "...", "a": 1, "b": 2, "c": 3 } ` `` ` ` ` an index on `(a ASC, b ASC, c ASC, **name** ASC)` will generate an index entry for this document since `a`, 'b', `c`, and `**name** ` are all present but an index of `(a ASC, d ASC, **name** ASC)` will not generate an index entry for this document since `d\` is missing. This means that such indexes can only be used to serve a query when the query has either implicit or explicit requirements that all fields from the index are present. `SPARSE_ALL = 1;` |
| `SPARSE_ANY` | An index entry will exist if ANY field are present in the document. This is used as the definition of a sparse index for Enterprise Edition databases. Take for example the following document: \``` ` { "name": "...", "a": 1, "b": 2, "c": 3 } ` `` ` ` ` an index on `(a ASC, d ASC)` will generate an index entry for this document since `a` is present, and will fill in an `unset` value for `d`. An index on `(d ASC, e ASC)` will not generate any index entry as neither `d` nor `e` are present.` ` ` ` An index that contains `**name** ` will generate an index entry for all documents since Firestore guarantees that all documents have a `**name**\` field. `SPARSE_ANY = 2;` |
| `SPARSE_ANY_VALUE` | An index entry will exist if ANY field are present in the document. This is used as the definition of a sparse index for Enterprise Edition databases. Take for example the following document: \``` ` { "name": "...", "a": 1, "b": 2, "c": 3 } ` `` ` ` ` an index on `(a ASC, d ASC)` will generate an index entry for this document since `a` is present, and will fill in an `unset` value for `d`. An index on `(d ASC, e ASC)` will not generate any index entry as neither `d` nor `e` are present.` ` ` ` An index that contains `**name** ` will generate an index entry for all documents since Firestore guarantees that all documents have a `**name**\` field. `SPARSE_ANY = 2;` |
| `UNRECOGNIZED` |   |

| ## Static Methods ||
|---|---|
| **Name** | **Description** |
| `forNumber(int value)` |   |
| `getDescriptor()` |   |
| `internalGetValueMap()` |   |
| `valueOf(Descriptors.EnumValueDescriptor desc)` |   |
| `valueOf(int value)` | **Deprecated.** *Use [#forNumber(int)](https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.admin.v1.Index.Density#com_google_firestore_admin_v1_Index_Density_forNumber_int_) instead.* |
| `valueOf(String name)` |   |
| `values()` |   |

| ## Methods ||
|---|---|
| **Name** | **Description** |
| `getDescriptorForType()` |   |
| `getNumber()` |   |
| `getValueDescriptor()` |   |