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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> LoadBalancer.CreateSubchannelArgs.Builder
addOption(LoadBalancer.CreateSubchannelArgs.Key<T> key, T value)
Add a custom option.LoadBalancer.CreateSubchannelArgs
build()
Creates a new args object.LoadBalancer.CreateSubchannelArgs.Builder
setAddresses(EquivalentAddressGroup addrs)
The addresses to connect to.LoadBalancer.CreateSubchannelArgs.Builder
setAddresses(List<EquivalentAddressGroup> addrs)
The addresses to connect to.LoadBalancer.CreateSubchannelArgs.Builder
setAttributes(Attributes attrs)
Attributes provided here will be included inLoadBalancer.Subchannel.getAttributes()
.
-
-
-
Method Detail
-
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
public LoadBalancer.CreateSubchannelArgs.Builder setAddresses(EquivalentAddressGroup addrs)
The addresses to connect to. All addresses are considered equivalent and will be tried in the order they are provided.
-
setAddresses
public LoadBalancer.CreateSubchannelArgs.Builder setAddresses(List<EquivalentAddressGroup> addrs)
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
public LoadBalancer.CreateSubchannelArgs.Builder setAttributes(Attributes attrs)
Attributes provided here will be included inLoadBalancer.Subchannel.getAttributes()
.This is an optional property. Default is empty if not set.
-
build
public LoadBalancer.CreateSubchannelArgs build()
Creates a new args object.
-
-