public ConnectorConfig build()

in alloydb-jdbc-connector/src/main/java/com/google/cloud/alloydb/ConnectorConfig.java [177:204]


    public ConnectorConfig build() {
      // validate only one GoogleCredentials configuration field set
      int googleCredsCount = 0;
      if (googleCredentials != null) {
        googleCredsCount++;
      }
      if (googleCredentialsPath != null) {
        googleCredsCount++;
      }
      if (googleCredentialsSupplier != null) {
        googleCredsCount++;
      }
      if (googleCredsCount > 1) {
        throw new IllegalStateException(
            "Invalid configuration, more than one GoogleCredentials field has a value "
                + "(googleCredentials, googleCredentialsPath, googleCredentialsSupplier)");
      }

      return new ConnectorConfig(
          targetPrincipal,
          delegates,
          adminServiceEndpoint,
          googleCredentialsSupplier,
          googleCredentials,
          googleCredentialsPath,
          quotaProject,
          refreshStrategy);
    }