Package io.grpc
Class LoadBalancer.CreateSubchannelArgs.Builder
java.lang.Object
io.grpc.LoadBalancer.CreateSubchannelArgs.Builder
- Enclosing class:
LoadBalancer.CreateSubchannelArgs
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771")
public static final class LoadBalancer.CreateSubchannelArgs.Builder
extends Object
-
Method Summary
Modifier and TypeMethodDescriptionaddOption
(LoadBalancer.CreateSubchannelArgs.Key<T> key, T value) Add a custom option.build()
Creates a new args object.The addresses to connect to.setAddresses
(List<EquivalentAddressGroup> addrs) The addresses to connect to.setAttributes
(Attributes attrs) Attributes provided here will be included inLoadBalancer.Subchannel.getAttributes()
.
-
Method Details
-
addOption
public <T> LoadBalancer.CreateSubchannelArgs.Builder addOption(LoadBalancer.CreateSubchannelArgs.Key<T> key, T value) Add a custom option. Any existing value for the key is overwritten.This is an optional property.
- Parameters:
key
- the option keyvalue
- the option value
-
setAddresses
The addresses to connect to. All addresses are considered equivalent and will be tried in the order they are provided. -
setAddresses
The addresses to connect to. All addresses are considered equivalent and will be tried in the order they are provided.This is a required property.
- Throws:
IllegalArgumentException
- ifaddrs
is empty
-
setAttributes
Attributes provided here will be included inLoadBalancer.Subchannel.getAttributes()
.This is an optional property. Default is empty if not set.
-
build
Creates a new args object.
-