Package net.shibboleth.idp.plugin.authn.webauthn.storage.impl

# Class CacheServiceImpl.Builder

java.lang.Object
net.shibboleth.idp.plugin.authn.webauthn.storage.impl.CacheServiceImpl.Builder

All Implemented Interfaces:
  `CacheServiceImpl.IBuildStage`, `CacheServiceImpl.IUserHandleMappingCacheStage`

Enclosing class:
  CacheServiceImpl

public static final class CacheServiceImpl.Builder extends Object implements CacheServiceImpl.IUserHandleMappingCacheStage, CacheServiceImpl.IBuildStage
A builder to safely construct this object.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Cache<String,String>`
`cacheBuild`
The cache.
`private Function<CredentialRecord,String>`
`keyExtractionStrategyBuild`
The key extraction strategy.
`private Function<com.yubico.webauthn.data.ByteArray,String>`
`lookupKeyExtractionStrategyBuild`
The lookup key extraction strategy.
`private Function<CredentialRecord,String>`
`valueExtractionStrategyBuild`
The value extraction strategy.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`Builder()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`CacheServiceImpl`
`build()`
Build the service.
`CacheServiceImpl.IBuildStage`
`withCache(Cache<String,String> cache)`
The userHandle to username mapping cache.
`CacheServiceImpl.IBuildStage`
`withKeyExtractionStrategy(Function<CredentialRecord,String> keyExtractionStrategy)`
The strategy to use to convert a `CredentialRecord` into a key suitable for the cache.
`CacheServiceImpl.IBuildStage`
`withLookupKeyExtractionStrategy(Function<com.yubico.webauthn.data.ByteArray,String> lookupKeyExtractionStrategy)`
The strategy to use to convert a ByteArray into a key suitable for the cache.
`CacheServiceImpl.IBuildStage`
`withValueExtractionStrategy(Function<CredentialRecord,String> valueExtractionStrategy)`
The strategy to use to convert a `CredentialRecord` into a key suitable for the cache.

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

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

## Field Details

### cacheBuild

@Nullable private Cache<String,String> cacheBuild
The cache.

### keyExtractionStrategyBuild

private Function<CredentialRecord,String> keyExtractionStrategyBuild
The key extraction strategy.

### lookupKeyExtractionStrategyBuild

private Function<com.yubico.webauthn.data.ByteArray,String> lookupKeyExtractionStrategyBuild
The lookup key extraction strategy.

### valueExtractionStrategyBuild

private Function<CredentialRecord,String> valueExtractionStrategyBuild
The value extraction strategy.

## Constructor Details

### Builder

private Builder()
Constructor.

## Method Details

### withCache

public CacheServiceImpl.IBuildStage withCache(@Nonnull Cache<String,String> cache)
Description copied from interface: `CacheServiceImpl.IUserHandleMappingCacheStage`
The userHandle to username mapping cache.

Specified by:
  `withCache` in interface `CacheServiceImpl.IUserHandleMappingCacheStage`
Parameters:
  `cache` - the cache implementation
Returns:
  the next stage

### withKeyExtractionStrategy

public CacheServiceImpl.IBuildStage withKeyExtractionStrategy(Function<CredentialRecord,String> keyExtractionStrategy)
Description copied from interface: `CacheServiceImpl.IBuildStage`
The strategy to use to convert a `CredentialRecord` into a key suitable for the cache.

Specified by:
  `withKeyExtractionStrategy` in interface `CacheServiceImpl.IBuildStage`
Parameters:
  `keyExtractionStrategy` - the strategy to use
Returns:
  the next stage

### withLookupKeyExtractionStrategy

public CacheServiceImpl.IBuildStage withLookupKeyExtractionStrategy(Function<com.yubico.webauthn.data.ByteArray,String> lookupKeyExtractionStrategy)
Description copied from interface: `CacheServiceImpl.IBuildStage`
The strategy to use to convert a ByteArray into a key suitable for the cache.

Specified by:
  `withLookupKeyExtractionStrategy` in interface `CacheServiceImpl.IBuildStage`
Parameters:
  `lookupKeyExtractionStrategy` - the strategy to use
Returns:
  the next stage

### withValueExtractionStrategy

public CacheServiceImpl.IBuildStage withValueExtractionStrategy(Function<CredentialRecord,String> valueExtractionStrategy)
Description copied from interface: `CacheServiceImpl.IBuildStage`
The strategy to use to convert a `CredentialRecord` into a key suitable for the cache.

Specified by:
  `withValueExtractionStrategy` in interface `CacheServiceImpl.IBuildStage`
Parameters:
  `valueExtractionStrategy` - the strategy to use
Returns:
  the next stage

### build

public CacheServiceImpl build()
Description copied from interface: `CacheServiceImpl.IBuildStage`
Build the service.

Specified by:
  `build` in interface `CacheServiceImpl.IBuildStage`
Returns:
  the instantiated cache service.