# Class GcpMultiEndpointOptions.Builder (1.11.0)

    public static class GcpMultiEndpointOptions.Builder

## Inheritance

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

## 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

### Builder(GcpMultiEndpointOptions options)

    public Builder(GcpMultiEndpointOptions options)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions` |

### Builder(List\<String\> endpoints)

    public Builder(List<String> endpoints)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `endpoints` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |

## Methods

### build()

    public GcpMultiEndpointOptions build()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions` |   |

### withChannelConfigurator(ApiFunction\<ManagedChannelBuilder\<?\>,ManagedChannelBuilder\<?\>\> channelConfigurator)

    public GcpMultiEndpointOptions.Builder withChannelConfigurator(ApiFunction<ManagedChannelBuilder<?>,ManagedChannelBuilder<?>> channelConfigurator)

Sets the channel configurator for the MultiEndpoint channel pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channelConfigurator` | `https://docs.cloud.google.com/java/docs/reference/api-common/latest/com.google.api.core.ApiFunction.html<io.grpc.ManagedChannelBuilder<?>,io.grpc.ManagedChannelBuilder<?>>` function to perform on the ManagedChannelBuilder in the channel pool. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions.Builder` |   |

### withChannelCredentials(ChannelCredentials channelCredentials)

    public GcpMultiEndpointOptions.Builder withChannelCredentials(ChannelCredentials channelCredentials)

Sets the channel credentials to use in the MultiEndpoint channel pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channelCredentials` | `io.grpc.ChannelCredentials` channel credentials. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions.Builder` |   |

### withEndpoints(List\<String\> endpoints)

    public GcpMultiEndpointOptions.Builder withEndpoints(List<String> endpoints)

Sets the endpoints of the MultiEndpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `endpoints` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` List of endpoints in the form of host:port in descending priority order. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions.Builder` |   |

### withName(String name)

    public GcpMultiEndpointOptions.Builder withName(String name)

Sets the name of the MultiEndpoint.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions.Builder` |   |

### withRecoveryTimeout(Duration recoveryTimeout)

    public GcpMultiEndpointOptions.Builder withRecoveryTimeout(Duration recoveryTimeout)

Sets the recovery timeout for the MultiEndpoint. See more info in the [MultiEndpoint](https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.multiendpoint.MultiEndpoint).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `recoveryTimeout` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` recovery timeout. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions.Builder` |   |

### withSwitchingDelay(Duration switchingDelay)

    public GcpMultiEndpointOptions.Builder withSwitchingDelay(Duration switchingDelay)

Sets the switching delay for the MultiEndpoint.

When switching between endpoints the MultiEndpoint will stick to previous endpoint for the
switching delay.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `switchingDelay` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` switching delay. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpMultiEndpointOptions.Builder` |   |