brapi-java-client/src/main/java/org/brapi/client/v2/BrAPIClient.java
public boolean authenticate(Function<Void, String> authHandler) throws ApiException {
        Optional<String> authToken = Optional.ofNullable(authHandler.apply(null));
        if(authToken.isPresent()) {
        	((OAuth) getAuthentication("AuthorizationToken")).setAccessToken(authToken.get());
            return true;
        } else {
            return false;
        }
    }
/**
     * Executes a user defined function to fetch an auth token from the BrAPI service, and store it in the {@link BrAPIClient}
     * @param authHandler User defined function to retrieve an auth token
     * @return true if auth succeeded, false otherwise
     * @throws ApiException
     */
Executes a user defined function to fetch an auth token from the BrAPI service, and store it in the  BrAPIClient
@param authHandler User defined function to retrieve an auth token
@return true if auth succeeded, false otherwise
@throws ApiException
Executes a user defined function to fetch an auth token from the BrAPI service and store it in the BrAPIClient @param authHandler User defined function to retrieve an auth token @return true if auth succeeded false otherwise @throws ApiException
public boolean authenticate(Function<Void, String> authHandler) throws ApiException {
        Optional<String> authToken = Optional.ofNullable(authHandler.apply(null));
        if(authToken.isPresent()) {
        	((OAuth) getAuthentication("AuthorizationToken")).setAccessToken(authToken.get());
            return true;
        } else {
            return false;
        }
    }
public boolean authenticate ( Function < Void , String > authHandler ) throws ApiException { Optional < String > authToken = Optional . ofNullable ( authHandler . apply ( null ) ) ; if ( authToken . isPresent ( ) ) { ( ( OAuth ) getAuthentication ( "AuthorizationToken" ) ) . setAccessToken ( authToken . get ( ) ) ; return true ; } else { return false ; } }
Executes a user defined function to fetch an auth token from the BrAPI service, and store it in the {@link BrAPIClient}
 @param authHandler User defined function to retrieve an auth token
 @return true if auth succeeded, false otherwise
 @throws ApiException
Executes a user defined function to fetch an auth token from the BrAPI service and store it in the { @link BrAPIClient } @param authHandler User defined function to retrieve an auth token @return true if auth succeeded false otherwise @throws ApiException