Package net.shibboleth.idp.authn.context.logic

# Class PrincipalInResultPredicate

java.lang.Object
net.shibboleth.idp.authn.context.logic.AbstractAuthenticationResultPredicate
net.shibboleth.idp.authn.context.logic.PrincipalInResultPredicate

All Implemented Interfaces:
  `Predicate<ProfileRequestContext>`

public class PrincipalInResultPredicate extends AbstractAuthenticationResultPredicate
Condition that checks for the presence of one or more `Principal` instances in a `Subject` in any of the `AuthenticationResult` instances evaluated by the parent class.

Since:
  5.2.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Set<Principal>`
`principals`
Principals to check for.

## Constructor Summary

Constructors
Constructor
Description
`PrincipalInResultPredicate()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`doMatch(ProfileRequestContext profileRequestContext, AuthenticationResult result)`
Match returns true iff at least one of the candidates is found in this result's `Subject`.
`void`
`setPrincipals(Collection<Principal> prins)`
Sets the principals to check for.

### Methods inherited from class net.shibboleth.idp.authn.context.logic.AbstractAuthenticationResultPredicate

`getAuthenticationResults, getIncludedFlows, isIncludeIntermediateResults, setIncludedFlows, setIncludeIntermediateResults, test`

### 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.Predicate

`and, negate, or`

## Field Details

### principals

@Nonnull private Set<Principal> principals
Principals to check for.

## Constructor Details

### PrincipalInResultPredicate

public PrincipalInResultPredicate()
Constructor.

## Method Details

### setPrincipals

public void setPrincipals(@Nullable Collection<Principal> prins)
Sets the principals to check for.

Parameters:
  `prins` - principals to check for

### doMatch

protected boolean doMatch(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationResult result)
Match returns true iff at least one of the candidates is found in this result's `Subject`.

Specified by:
  `doMatch` in class `AbstractAuthenticationResultPredicate`
Parameters:
  `profileRequestContext` - profile request context
  `result` - result to evaluate
Returns:
  as above