# Class CompositeIndexManager (5.0.3)

    public class CompositeIndexManager

Composite index management operations needed by the datastore api.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> CompositeIndexManager

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [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.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [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-)

## Constructors

### CompositeIndexManager()

    public CompositeIndexManager()

## Methods

### compositeIndexForQuery(CompositeIndexManager.IndexComponentsOnlyQuery indexOnlyQuery)

    protected OnestoreEntity.@Nullable Index compositeIndexForQuery(CompositeIndexManager.IndexComponentsOnlyQuery indexOnlyQuery)

Given a IndexComponentsOnlyQuery, return the Index needed to fulfill the query,
or `null` if no index is needed.

This code needs to remain in sync with its counterparts in other languages. If you modify
this code please make sure you make the same update in the local datastore for other languages.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `indexOnlyQuery` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CompositeIndexManager.IndexComponentsOnlyQuery` The query. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.storage.onestore.v3_bytes.proto2api.OnestoreEntity.@org.jspecify.annotations.Nullable Index` | The index that must be present in order to fulfill the query, or `null` if no index is needed. |

### generateXmlForIndex(OnestoreEntity.Index index, CompositeIndexManager.IndexSource source)

    protected String generateXmlForIndex(OnestoreEntity.Index index, CompositeIndexManager.IndexSource source)

Generate an xml representation of the provided Index.

<br />

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `com.google.storage.onestore.v3_bytes.proto2api.OnestoreEntity.Index` The index for which we want an xml representation. |
| `source` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CompositeIndexManager.IndexSource` The source of the provided index. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The xml representation of the provided index. |

### minimumCompositeIndexForQuery(CompositeIndexManager.IndexComponentsOnlyQuery indexOnlyQuery, Collection\<OnestoreEntity.Index\> indexes)

    protected OnestoreEntity.@Nullable Index minimumCompositeIndexForQuery(CompositeIndexManager.IndexComponentsOnlyQuery indexOnlyQuery, Collection<OnestoreEntity.Index> indexes)

Given a IndexComponentsOnlyQuery and a collection of existing Indexs, return
the minimum Index needed to fulfill the query, or `null` if no index is needed.

This code needs to remain in sync with its counterparts in other languages. If you modify
this code please make sure you make the same update in the local datastore for other languages.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `indexOnlyQuery` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CompositeIndexManager.IndexComponentsOnlyQuery` The query. |
| `indexes` | `https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html<com.google.storage.onestore.v3_bytes.proto2api.OnestoreEntity.Index>` The existing indexes. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.storage.onestore.v3_bytes.proto2api.OnestoreEntity.@org.jspecify.annotations.Nullable Index` | The minimum index that must be present in order to fulfill the query, or `null` if no index is needed. |