# Interface EnvironmentOrBuilder (0.16.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.16.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.EnvironmentOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.batch.v1.EnvironmentOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.batch.v1.EnvironmentOrBuilder)

    public interface EnvironmentOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### containsSecretVariables(String key)

    public abstract boolean containsSecretVariables(String key)

A map of environment variable names to Secret Manager secret names.
The VM will access the named secrets to set the value of each environment
variable.

`map<string, string> secret_variables = 2;`

| **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` |   |

### containsVariables(String key)

    public abstract boolean containsVariables(String key)

A map of environment variable names to values.

`map<string, string> variables = 1;`

| **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` |   |

### getEncryptedVariables()

    public abstract Environment.KMSEnvMap getEncryptedVariables()

An encrypted JSON dictionary where the key/value pairs correspond to
environment variable names and their values.

`.google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.Environment.KMSEnvMap` | The encryptedVariables. |

### getEncryptedVariablesOrBuilder()

    public abstract Environment.KMSEnvMapOrBuilder getEncryptedVariablesOrBuilder()

An encrypted JSON dictionary where the key/value pairs correspond to
environment variable names and their values.

`.google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.Environment.KMSEnvMapOrBuilder` |   |

### getSecretVariables()

    public abstract Map<String,String> getSecretVariables()

Use [#getSecretVariablesMap()](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.EnvironmentOrBuilder#com_google_events_cloud_batch_v1_EnvironmentOrBuilder_getSecretVariablesMap__) 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.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getSecretVariablesCount()

    public abstract int getSecretVariablesCount()

A map of environment variable names to Secret Manager secret names.
The VM will access the named secrets to set the value of each environment
variable.

`map<string, string> secret_variables = 2;`

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

### getSecretVariablesMap()

    public abstract Map<String,String> getSecretVariablesMap()

A map of environment variable names to Secret Manager secret names.
The VM will access the named secrets to set the value of each environment
variable.

`map<string, string> secret_variables = 2;`

| **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.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getSecretVariablesOrDefault(String key, String defaultValue)

    public abstract String getSecretVariablesOrDefault(String key, String defaultValue)

A map of environment variable names to Secret Manager secret names.
The VM will access the named secrets to set the value of each environment
variable.

`map<string, string> secret_variables = 2;`

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getSecretVariablesOrThrow(String key)

    public abstract String getSecretVariablesOrThrow(String key)

A map of environment variable names to Secret Manager secret names.
The VM will access the named secrets to set the value of each environment
variable.

`map<string, string> secret_variables = 2;`

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getVariables()

    public abstract Map<String,String> getVariables()

Use [#getVariablesMap()](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.EnvironmentOrBuilder#com_google_events_cloud_batch_v1_EnvironmentOrBuilder_getVariablesMap__) 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.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getVariablesCount()

    public abstract int getVariablesCount()

A map of environment variable names to values.

`map<string, string> variables = 1;`

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

### getVariablesMap()

    public abstract Map<String,String> getVariablesMap()

A map of environment variable names to values.

`map<string, string> variables = 1;`

| **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.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getVariablesOrDefault(String key, String defaultValue)

    public abstract String getVariablesOrDefault(String key, String defaultValue)

A map of environment variable names to values.

`map<string, string> variables = 1;`

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getVariablesOrThrow(String key)

    public abstract String getVariablesOrThrow(String key)

A map of environment variable names to values.

`map<string, string> variables = 1;`

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### hasEncryptedVariables()

    public abstract boolean hasEncryptedVariables()

An encrypted JSON dictionary where the key/value pairs correspond to
environment variable names and their values.

`.google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the encryptedVariables field is set. |