private LoginCredentials(String username, Optional<String> password, Optional<String> privateKey, boolean authenticateSudo) { super(username, privateKey.isPresent() && isPrivateKeyCredential(privateKey.get()) ? privateKey.get() : password.orNull()); this.authenticateSudo = authenticateSudo; this.password = checkNotNull(password, "password"); this.privateKey = checkNotNull(privateKey, "privateKey"); }
private LoginCredentials(String username, @Nullable Optional<String> password, @Nullable Optional<String> privateKey, boolean authenticateSudo) { super(username, privateKey != null && privateKey.isPresent() && isPrivateKeyCredential(privateKey.get()) ? privateKey.get() : (password != null && password.isPresent() ? password.get() : null)); this.authenticateSudo = authenticateSudo; this.password = password; this.privateKey = privateKey; }
private LoginCredentials(String username, @Nullable Optional<String> password, @Nullable Optional<String> privateKey, boolean authenticateSudo) { super(username, privateKey != null && privateKey.isPresent() && isPrivateKeyCredential(privateKey.get()) ? privateKey.get() : (password != null && password.isPresent() ? password.get() : null)); this.authenticateSudo = authenticateSudo; this.password = password; this.privateKey = privateKey; }
private LoginCredentials(String username, @Nullable Optional<String> password, @Nullable Optional<String> privateKey, boolean authenticateSudo) { super(username, privateKey != null && privateKey.isPresent() && isPrivateKeyCredential(privateKey.get()) ? privateKey.get() : (password != null && password.isPresent() ? password.get() : null)); this.authenticateSudo = authenticateSudo; this.password = password; this.privateKey = privateKey; }
private LoginCredentials(String username, Optional<String> password, Optional<String> privateKey, boolean authenticateSudo) { super(username, privateKey.isPresent() && isPrivateKeyCredential(privateKey.get()) ? privateKey.get() : password.orNull()); this.authenticateSudo = authenticateSudo; this.password = checkNotNull(password, "password"); this.privateKey = checkNotNull(privateKey, "privateKey"); }
private LoginCredentials(String username, Optional<String> password, Optional<String> privateKey, boolean authenticateSudo) { super(username, privateKey.isPresent() && isPrivateKeyCredential(privateKey.get()) ? privateKey.get() : password.orNull()); this.authenticateSudo = authenticateSudo; this.password = checkNotNull(password, "password"); this.privateKey = checkNotNull(privateKey, "privateKey"); }