public NCClient build()

in src/main/java/org/apache/nlpcraft/client/NCClientBuilder.java [126:150]


    public NCClient build() throws IOException, NCClientException {
        if (impl.getEmail() == null && impl.getPassword() != null ||
            impl.getEmail() != null && impl.getPassword() == null
        )
            throw new IllegalArgumentException("Both email and password should be null or not null.");
        
        if (impl.getBaseUrl() == null)
            impl.setBaseUrl(DFLT_BASEURL);
        
        if (impl.getClientSupplier() == null)
            impl.setClientSupplier(HttpClients::createDefault);
        
        if (impl.getEmail() == null)
            impl.setEmail(DFLT_EMAIL);
    
        if (impl.getPassword() == null)
            impl.setPassword(DFLT_PWD);
        
        if (impl.isCancelOnExit() == null)
            impl.setCancelOnExit(DFLT_CANCEL_ON_EXIT);

        impl.initialize();
        
        return impl;
    }