public RecaptchaConfig build()

in src/main/java/com/google/recaptcha/pld/pld/model/RecaptchaConfig.java [61:73]


    public RecaptchaConfig build() throws IllegalArgumentException {
      if (nullOrEmpty(projectId)) {
        throw new IllegalArgumentException(Messages.MISSING_PROJECT_ID_MESSAGE);
      }
      if (authMethod == null) {
        throw new IllegalArgumentException(Messages.AUTH_REQUIRED_MESSAGE);
      }
      if (authMethod == RecaptchaAuthMethod.API_KEY && nullOrEmpty(apiKey)) {
        throw new IllegalArgumentException(Messages.EMPTY_API_KEY_MESSAGE);
      }

      return new RecaptchaConfig(this);
    }