public ConnectorConfig build()

in core/src/main/java/com/google/cloud/sql/ConnectorConfig.java [259:295]


    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)");
      }
      if (adminRootUrl != null && universeDomain != null) {
        throw new IllegalStateException(
            "Can not set Admin API Endpoint and Universe Domain together, "
                + "set only Admin API Endpoint (it already contains the universe domain)");
      }

      return new ConnectorConfig(
          targetPrincipal,
          delegates,
          adminRootUrl,
          adminServicePath,
          googleCredentialsSupplier,
          googleCredentials,
          googleCredentialsPath,
          adminQuotaProject,
          universeDomain,
          refreshStrategy,
          instanceNameResolver,
          failoverPeriod);
    }