Package net.shibboleth.idp.consent.logic.impl

# Class AttributeValueLookupFunction

java.lang.Object
net.shibboleth.idp.consent.logic.impl.AttributeValueLookupFunction

All Implemented Interfaces:
  `Function<ProfileRequestContext,String>`, `ContextDataLookupFunction<ProfileRequestContext,String>`

public class AttributeValueLookupFunction extends Object implements ContextDataLookupFunction<ProfileRequestContext,String>
`ContextDataLookupFunction` to return the value of an attribute from an `AttributeContext`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,AttributeContext>`
`attributeContextLookupStrategy`
Strategy used to find the `AttributeContext` from the `ProfileRequestContext`.
`private String`
`attributeId`
The attribute ID to look for.
`private final org.slf4j.Logger`
`log`
Class logger.
`private boolean`
`useUnfilteredAttributes`
Whether to use filtered or unfiltered attributes.

## Constructor Summary

Constructors
Constructor
Description
`AttributeValueLookupFunction(String userAttributeId)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`apply(ProfileRequestContext input)`
`void`
`setAttributeContextLookupStrategy(Function<ProfileRequestContext,AttributeContext> strategy)`
Set the attribute context lookup strategy.
`void`
`setUseUnfilteredAttributes(boolean flag)`
Set whether to use filtered or unfiltered attributes.

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

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

### Methods inherited from interface java.util.function.Function

`andThen, compose`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### attributeId

@Nonnull @NotEmpty private String attributeId
The attribute ID to look for.

### attributeContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
Strategy used to find the `AttributeContext` from the `ProfileRequestContext`.

### useUnfilteredAttributes

private boolean useUnfilteredAttributes
Whether to use filtered or unfiltered attributes.

## Constructor Details

### AttributeValueLookupFunction

public AttributeValueLookupFunction(@Nonnull @NotEmpty String userAttributeId)
Constructor.

Parameters:
  `userAttributeId` - the attribute id

## Method Details

### setAttributeContextLookupStrategy

public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)
Set the attribute context lookup strategy.

Parameters:
  `strategy` - the attribute context lookup strategy

### setUseUnfilteredAttributes

public void setUseUnfilteredAttributes(boolean flag)
Set whether to use filtered or unfiltered attributes.

Defaults to true.

Parameters:
  `flag` - flag to set

### apply

@Nullable public String apply(@Nullable ProfileRequestContext input)

Specified by:
  `apply` in interface `Function<ProfileRequestContext,String>`