/** * Returns {@code true} if and only if the supplied connection class and user class are supported by at least one * factory. * * @param connectionClass the connection class. * @param userClass the user class. * @param <C> the type of connection. * @param <U> the type of user. * @return {@code true} if and only if the supplied connection class and user class are supported by at least one * factory. */ public static <C, U extends StandardUsernameCredentials> boolean isSupported(@NonNull Class<C> connectionClass, @NonNull Class<U> userClass) { connectionClass.getClass(); // throw NPE if null userClass.getClass(); // throw NPE if null for (SSHAuthenticatorFactory factory : ExtensionList.lookup(SSHAuthenticatorFactory.class)) { if (factory.supports(connectionClass, userClass)) { return true; } } return false; }