# Class HttpBuildCacheCredentials

java.lang.Object
org.gradle.caching.http.HttpBuildCacheCredentials

All Implemented Interfaces:
  `Credentials, PasswordCredentials`

public class HttpBuildCacheCredentials extends Object implements PasswordCredentials
Credentials for authenticating with an HTTP build cache.

When configured on `HttpBuildCache`, these credentials are sent using HTTP Basic authentication (i.e. via the `Authorization: Basic` header).

Since:
  3.5
See Also:
  - `HttpBuildCache`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HttpBuildCacheCredentials()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `@Nullable String`
  `getPassword()`
  Returns the password to use when authenticating to the HTTP build cache.
  `@Nullable String`
  `getUsername()`
  Returns the user name to use when authenticating to the HTTP build cache.
  `void`
  `setPassword(@Nullable String password)`
  Sets the password to use when authenticating to the HTTP build cache.
  `void`
  `setUsername(@Nullable String username)`
  Sets the user name to use when authenticating to the HTTP build cache.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### HttpBuildCacheCredentials

    public HttpBuildCacheCredentials()

- ## Method Details

  - ### getUsername

    public @Nullable String getUsername()
    Returns the user name to use when authenticating to the HTTP build cache.
    Specified by:
      `getUsername` in interface `PasswordCredentials`
    Returns:
      The user name. May be null.

  - ### setUsername

    public void setUsername(@Nullable String username)
    Sets the user name to use when authenticating to the HTTP build cache.
    Specified by:
      `setUsername` in interface `PasswordCredentials`
    Parameters:
      `username` - The user name. May be null.

  - ### getPassword

    public @Nullable String getPassword()
    Returns the password to use when authenticating to the HTTP build cache.
    Specified by:
      `getPassword` in interface `PasswordCredentials`
    Returns:
      The password. May be null.

  - ### setPassword

    public void setPassword(@Nullable String password)
    Sets the password to use when authenticating to the HTTP build cache.
    Specified by:
      `setPassword` in interface `PasswordCredentials`
    Parameters:
      `password` - The password. May be null.