Send feedback
  
   
 
  
    
      Class StubSettings.Builder<SettingsT,B> (2.71.0) 
  
  
  
   
  
    
  
  
    
    
    
    
    
  Version latestkeyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   abstract   static   class  StubSettings . Builder<SettingsT , B > 
  
  
  
    
      
        Type Parameters  
      
        Name Description  
      
        SettingsT 
      
        B 
     
  
  Static Methods
   
  applyToAllUnaryMethods(Iterable<UnaryCallSettings.Builder<?,?>> methodSettingsBuilders, ApiFunction<UnaryCallSettings.Builder<?,?>,Void> settingsUpdater) 
  
    
protected   static   void   applyToAllUnaryMethods ( Iterable<UnaryCallSettings . Builder <? , ? >>  methodSettingsBuilders ,   ApiFunction<UnaryCallSettings . Builder <? , ? >, Void >  settingsUpdater )  
  Applies the given settings updater function to the given method settings builders.
Constructors
   
  Builder() 
  
  Builder(ClientContext clientContext) 
  
    
protected   Builder ( ClientContext   clientContext )  
  
  Builder(StubSettings settings) 
  
    
protected   Builder ( StubSettings   settings )  
  Create a builder from a StubSettings object.
Methods
   
  <B>build() 
  
    
public   abstract   StubSettings<B>   <B>build ()  
  
  
  getApiKey() 
  
    
public   final   String   getApiKey ()  
  Gets the API Key that was previously set on this Builder.
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  getBackgroundExecutorProvider() 
  
    
public   ExecutorProvider   getBackgroundExecutorProvider ()  
  Gets the ExecutorProvider that was previously set on this Builder.
getClock() 
  
    
public   ApiClock   getClock ()  
  Gets the ApiClock that was previously set on this Builder.
getCredentialsProvider() 
  
    
public   CredentialsProvider   getCredentialsProvider ()  
  Gets the CredentialsProvider that was previously set on this Builder.
getEndpoint() 
  
    
public   String   getEndpoint ()  
  
    
      
        Returns  
      
        Type Description  
      
        String the resolved endpoint when the Builder was created. If invoked after
     StubSettings.newBuilder() is called, it will return the clientSettingsEndpoint value.
     If other parameters are then set in the builder, the resolved endpoint is not
     automatically updated. The resolved endpoint will only be recomputed when the
     StubSettings is built again.
 
     
  
  getExecutorProvider() (deprecated) 
  
    
public   ExecutorProvider   getExecutorProvider ()  
  
  
  getGdchApiAudience() 
  
    
public   String   getGdchApiAudience ()  
  Gets the GDCH API audience that was previously set in this Builder
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  
  
  
    
public   HeaderProvider   getHeaderProvider ()  
  Gets the custom HeaderProvider that was previously set on this Builder.
    
protected   HeaderProvider   getInternalHeaderProvider ()  
  Gets the internal HeaderProvider that was previously set on this Builder.
getMtlsEndpoint() 
  
    
public   String   getMtlsEndpoint ()  
  
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  getQuotaProjectId() 
  
    
public   String   getQuotaProjectId ()  
  Gets the QuotaProjectId that was previously set on this Builder.
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  getStreamWatchdogCheckInterval() 
  
    
public   Duration   getStreamWatchdogCheckInterval ()  
  
Obsolete 
Use getStreamWatchdogCheckIntervalDuration() instead 
This feature is stable for usage in this major version, but may be deprecated in a future release.
 
This method is obsolete. Use #getStreamWatchdogCheckIntervalDuration()  instead
    
      
        Returns  
      
        Type Description  
      
        org.threeten.bp.Duration  
     
  
  getStreamWatchdogCheckIntervalDuration() 
  
    
public   Duration   getStreamWatchdogCheckIntervalDuration ()  
  
  getStreamWatchdogProvider() 
  
    
public   WatchdogProvider   getStreamWatchdogProvider ()  
  
  
  getTracerFactory() 
  
    
public   ApiTracerFactory   getTracerFactory ()  
  
Beta 
The surface for tracing is not stable yet and may change in the future. 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
getTransportChannelProvider() 
  
    
public   TransportChannelProvider   getTransportChannelProvider ()  
  Gets the TransportProvider that was previously set on this Builder.
self() 
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setApiKey(String apiKey) 
  
    
public   B   setApiKey ( String   apiKey )  
  Sets the API key. The API key will get translated to an com.google.auth.ApiKeyCredentials  and stored in ClientContext .
 
API Key authorization is not supported for every product. Please check the documentation
 for each product to confirm if it is supported.
 
Note: If you set an API key and CredentialsProvider  in the same ClientSettings the
 API key will override any credentials provided.
    
      
        Parameter  
      
        Name Description  
      
        apiKeyString  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setBackgroundExecutorProvider(ExecutorProvider backgroundExecutorProvider) 
  
    
public   B   setBackgroundExecutorProvider ( ExecutorProvider   backgroundExecutorProvider )  
  Sets the executor to use for running scheduled API call logic (such as retries and
 long-running operations).
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setClock(ApiClock clock) 
  
    
public   B   setClock ( ApiClock   clock )  
  Sets the clock to use for retry logic.
 
This will default to a system clock if it is not set.
    
      
        Parameter  
      
        Name Description  
      
        clockApiClock  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setCredentialsProvider(CredentialsProvider credentialsProvider) 
  
    
public   B   setCredentialsProvider ( CredentialsProvider   credentialsProvider )  
  Sets the CredentialsProvider to use for getting the credentials to make calls with.
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setEndpoint(String endpoint) 
  
    
public   B   setEndpoint ( String   endpoint )  
  
    
      
        Parameter  
      
        Name Description  
      
        endpointString  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setExecutorProvider(ExecutorProvider executorProvider) (deprecated) 
  
    
public   B   setExecutorProvider ( ExecutorProvider   executorProvider )  
  
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setGdchApiAudience(String gdchApiAudience) 
  
    
public   B   setGdchApiAudience ( String   gdchApiAudience )  
  Sets the API audience used by com.google.auth.oauth2.GdchCredentials  It cannot be
 used if other type of com.google.auth.Credentials  is used. If the provided
 credentials already have an api audience set, then it will be overriden by this audience
    
      
        Parameter  
      
        Name Description  
      
        gdchApiAudienceString the audience to be used - must be a valid URI string
 
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  
  
  
    
public   B   setHeaderProvider ( HeaderProvider   headerProvider )  
  Sets the HeaderProvider for getting custom static headers for http requests. The header
 provider will be called during client construction only once. The headers returned by the
 provider will be cached and supplied as is for each request issued by the constructed client.
 Some reserved headers can be overridden (e.g. Content-Type) or merged with the default value
 (e.g. User-Agent) by the underlying transport layer.
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  
  
  
    
protected   B   setInternalHeaderProvider ( HeaderProvider   internalHeaderProvider )  
  Sets the HeaderProvider for getting internal (library-defined) static headers for http
 requests. The header provider will be called during client construction only once. The
 headers returned by the provider will be cached and supplied as is for each request issued by
 the constructed client. Some reserved headers can be overridden (e.g. Content-Type) or merged
 with the default value (e.g. User-Agent) by the underlying transport layer.
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setMtlsEndpoint(String mtlsEndpoint) 
  
    
public   B   setMtlsEndpoint ( String   mtlsEndpoint )  
  
    
      
        Parameter  
      
        Name Description  
      
        mtlsEndpointString  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setQuotaProjectId(String quotaProjectId) 
  
    
public   B   setQuotaProjectId ( String   quotaProjectId )  
  
    
      
        Parameter  
      
        Name Description  
      
        quotaProjectIdString  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setStreamWatchdogCheckInterval(Duration checkInterval) 
  
    
public   B   setStreamWatchdogCheckInterval ( Duration   checkInterval )  
  
  
    
      
        Parameter  
      
        Name Description  
      
        checkIntervalorg.threeten.bp.Duration  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setStreamWatchdogCheckIntervalDuration(Duration checkInterval) 
  
    
public   B   setStreamWatchdogCheckIntervalDuration ( Duration   checkInterval )  
  Sets how often the Watchdog  will check ongoing streaming RPCs. Defaults to 10 secs.
 Use java.time.Duration#ZERO  to disable.
    
      
        Parameter  
      
        Name Description  
      
        checkIntervalDuration  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setStreamWatchdogProvider(WatchdogProvider streamWatchdogProvider) 
  
    
public   B   setStreamWatchdogProvider ( WatchdogProvider   streamWatchdogProvider )  
  
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setSwitchToMtlsEndpointAllowed(boolean switchToMtlsEndpointAllowed) 
  
    
protected   B   setSwitchToMtlsEndpointAllowed ( boolean   switchToMtlsEndpointAllowed )  
  
    
      
        Parameter  
      
        Name Description  
      
        switchToMtlsEndpointAllowedboolean  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setTracerFactory(ApiTracerFactory tracerFactory) 
  
    
public   B   setTracerFactory ( ApiTracerFactory   tracerFactory )  
  
Beta 
The surface for tracing is not stable yet and may change in the future. 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
Configures the ApiTracerFactory  that will be used to generate traces.
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setTransportChannelProvider(TransportChannelProvider transportChannelProvider) 
  
    
public   B   setTransportChannelProvider ( TransportChannelProvider   transportChannelProvider )  
  Sets the TransportProvider to use for getting the transport-specific context to make calls
 with.
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  setUniverseDomain(String universeDomain) 
  
    
public   B   setUniverseDomain ( String   universeDomain )  
  
    
      
        Parameter  
      
        Name Description  
      
        universeDomainString  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        B  
     
  
  toString() 
  
  
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  Overrides 
  
 
     
    
  
  
  
     
  
    
    
      
       
         
  
  
    
    Send feedback
  
   
 
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-29 UTC.
 
 
  
  
    
    
    
      
  
  
    Need to tell us more?
  
   
 
     
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-29 UTC."],[],[]]