Package net.shibboleth.shared.spring.httpclient.factory

# Class UsernamePasswoordCredentialsFactoryBean

java.lang.Object
net.shibboleth.shared.spring.factory.AbstractFactoryBean<T>
net.shibboleth.shared.spring.factory.AbstractComponentAwareFactoryBean<org.apache.hc.client5.http.auth.UsernamePasswordCredentials>
net.shibboleth.shared.spring.httpclient.factory.UsernamePasswoordCredentialsFactoryBean

All Implemented Interfaces:
  `Aware`, `BeanClassLoaderAware`, `BeanFactoryAware`, `DisposableBean`, `FactoryBean<org.apache.hc.client5.http.auth.UsernamePasswordCredentials>`, `InitializingBean`

public class UsernamePasswoordCredentialsFactoryBean extends AbstractComponentAwareFactoryBean<org.apache.hc.client5.http.auth.UsernamePasswordCredentials>
Factory bean for `UsernamePasswordCredentials`.

Mainly for insulation from Apache client API.

Since:
  9.0.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`password`
The password.
`private String`
`username`
The username.

### Fields inherited from interface org.springframework.beans.factory.FactoryBean

`OBJECT_TYPE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`UsernamePasswoordCredentialsFactoryBean()`

## Method Summary

Modifier and Type
Method
Description
`protected org.apache.hc.client5.http.auth.UsernamePasswordCredentials`
`doCreateInstance()`
Call the parent class to create the instance.
`Class<?>`
`getObjectType()`
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
`void`
`setPassword(String what)`
Set the password.
`void`
`setUsername(String what)`
Set the username.

### Methods inherited from class net.shibboleth.shared.spring.factory.AbstractComponentAwareFactoryBean

`createInstance, destroyInstance, setThrowIfNull`

### Methods inherited from class net.shibboleth.shared.spring.factory.AbstractFactoryBean

`afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### username

@Nullable private String username
The username.

### password

@Nullable private String password
The password.

## Constructor Details

### UsernamePasswoordCredentialsFactoryBean

public UsernamePasswoordCredentialsFactoryBean()

## Method Details

### getObjectType

@Nonnull public Class<?> getObjectType()
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
  `getObjectType` in interface `FactoryBean<org.apache.hc.client5.http.auth.UsernamePasswordCredentials>`
Specified by:
  `getObjectType` in class `AbstractFactoryBean<org.apache.hc.client5.http.auth.UsernamePasswordCredentials>`
See Also:
  - `FactoryBean.getObjectType()`

### setUsername

public void setUsername(@Nullable String what)
Set the username.

Parameters:
  `what` - value to set

### setPassword

public void setPassword(@Nullable String what)
Set the password.

Parameters:
  `what` - value to set

### doCreateInstance

@Nonnull protected org.apache.hc.client5.http.auth.UsernamePasswordCredentials doCreateInstance() throws Exception
Call the parent class to create the instance.

Specified by:
  `doCreateInstance` in class `AbstractComponentAwareFactoryBean<org.apache.hc.client5.http.auth.UsernamePasswordCredentials>`
Returns:
  the bean.
Throws:
  `Exception` - if needed.