1616
1717package io .grpc .binder .internal ;
1818
19+ import static com .google .common .base .Preconditions .checkNotNull ;
20+
1921import io .grpc .ChannelLogger ;
2022import io .grpc .internal .ClientTransportFactory .ClientTransportOptions ;
2123import io .grpc .internal .TestUtils .NoopChannelLogger ;
@@ -33,27 +35,28 @@ public class BinderClientTransportBuilder {
3335 new ClientTransportOptions ();
3436
3537 public BinderClientTransportBuilder setServerAddress (SocketAddress serverAddress ) {
36- this .serverAddress = serverAddress ;
38+ this .serverAddress = checkNotNull ( serverAddress ) ;
3739 return this ;
3840 }
3941
4042 public BinderClientTransportBuilder setChannelLogger (ChannelLogger channelLogger ) {
41- this .channelLogger = channelLogger ;
43+ this .channelLogger = checkNotNull ( channelLogger ) ;
4244 return this ;
4345 }
4446
4547 public BinderClientTransportBuilder setClientTransportOptions (ClientTransportOptions options ) {
46- this .options = options ;
48+ this .options = checkNotNull ( options ) ;
4749 return this ;
4850 }
4951
5052 public BinderClientTransportBuilder setClientTransportFactory (
5153 BinderClientTransportFactory factory ) {
52- this .factory = factory ;
54+ this .factory = checkNotNull ( factory ) ;
5355 return this ;
5456 }
5557
5658 public BinderTransport .BinderClientTransport build () {
57- return factory .newClientTransport (serverAddress , options , channelLogger );
59+ return factory .newClientTransport (
60+ checkNotNull (serverAddress ), checkNotNull (options ), checkNotNull (channelLogger ));
5861 }
5962}
0 commit comments