# Interface CustomContextUpdatesOrBuilder (0.33.0)

0.33.0 (latest) 0.31.0 0.28.0 0.27.0 0.25.0 0.23.0 0.22.0 0.20.0 0.18.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.10.0 0.8.0 0.7.0 0.4.0 0.3.0 0.2.0

    public interface CustomContextUpdatesOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### containsUpdates(String key)

    public abstract boolean containsUpdates(String key)

Optional. Insert or update the existing custom contexts.

`
map<string, .google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload> updates = 1 [(.google.api.field_behavior) = OPTIONAL];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getKeysToClear(int index)

    public abstract String getKeysToClear(int index)

Optional. Custom contexts to clear by key.
A key cannot be present in both `updates` and `keys_to_clear`.

`repeated string keys_to_clear = 2 [(.google.api.field_behavior) = OPTIONAL];`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The keysToClear at the given index. |

### getKeysToClearBytes(int index)

    public abstract ByteString getKeysToClearBytes(int index)

Optional. Custom contexts to clear by key.
A key cannot be present in both `updates` and `keys_to_clear`.

`repeated string keys_to_clear = 2 [(.google.api.field_behavior) = OPTIONAL];`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the value to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes of the keysToClear at the given index. |

### getKeysToClearCount()

    public abstract int getKeysToClearCount()

Optional. Custom contexts to clear by key.
A key cannot be present in both `updates` and `keys_to_clear`.

`repeated string keys_to_clear = 2 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of keysToClear. |

### getKeysToClearList()

    public abstract List<String> getKeysToClearList()

Optional. Custom contexts to clear by key.
A key cannot be present in both `updates` and `keys_to_clear`.

`repeated string keys_to_clear = 2 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | A list containing the keysToClear. |

### getUpdates() (deprecated)

    public abstract Map<String,ObjectCustomContextPayload> getUpdates()

Use [#getUpdatesMap()](https://docs.cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/com.google.cloud.storagebatchoperations.v1.CustomContextUpdatesOrBuilder#com_google_cloud_storagebatchoperations_v1_CustomContextUpdatesOrBuilder_getUpdatesMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/com.google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload>` |   |

### getUpdatesCount()

    public abstract int getUpdatesCount()

Optional. Insert or update the existing custom contexts.

`
map<string, .google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload> updates = 1 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getUpdatesMap()

    public abstract Map<String,ObjectCustomContextPayload> getUpdatesMap()

Optional. Insert or update the existing custom contexts.

`
map<string, .google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload> updates = 1 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/com.google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload>` |   |

### getUpdatesOrDefault(String key, ObjectCustomContextPayload defaultValue)

    public abstract ObjectCustomContextPayload getUpdatesOrDefault(String key, ObjectCustomContextPayload defaultValue)

Optional. Insert or update the existing custom contexts.

`
map<string, .google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload> updates = 1 [(.google.api.field_behavior) = OPTIONAL];
`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/com.google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/com.google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload` |   |

### getUpdatesOrThrow(String key)

    public abstract ObjectCustomContextPayload getUpdatesOrThrow(String key)

Optional. Insert or update the existing custom contexts.

`
map<string, .google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload> updates = 1 [(.google.api.field_behavior) = OPTIONAL];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/com.google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload` |   |