Package org.opensaml.saml.common.profile.logic

# Class EntityAttributesPredicate

java.lang.Object
org.opensaml.saml.common.profile.logic.EntityAttributesPredicate

All Implemented Interfaces:
  `Predicate<EntityDescriptor>`

public class EntityAttributesPredicate extends Object implements Predicate<EntityDescriptor>
Predicate to determine whether an `EntityDescriptor` or its parent groups contain an `EntityAttributes` extension `Attribute` that matches the predicate's criteria.

This class uses a nested helper class, `EntityAttributesPredicate.Candidate`, to capture the rules to check for, with each such object representing a single condition that the predicate can combine either via an AND or OR semantic to produce the final result. Each `EntityAttributesPredicate.Candidate`'s own matching rules must match entirely.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`EntityAttributesPredicate.Candidate`
An object to encapsulate the set of criteria that must be satisfied by an `EntityAttributes` extension to satisfy the enclosing predicate.
`private class`
`EntityAttributesPredicate.EntityAttributesMatcher`
Determines whether an `EntityAttributesPredicate.Candidate` criterion is satisfied by the `Attribute`s in an `EntityAttributes` extension.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Collection<EntityAttributesPredicate.Candidate>`
`candidateSet`
Candidates to check for.
`private final org.slf4j.Logger`
`log`
Class logger.
`private final boolean`
`matchAll`
Whether all the candidates must match.
`private final boolean`
`trimTags`
Whether to trim the values in the metadata before comparison.

## Constructor Summary

Constructors
Constructor
Description
`EntityAttributesPredicate(Collection<EntityAttributesPredicate.Candidate> candidates)`
Constructor.
`EntityAttributesPredicate(Collection<EntityAttributesPredicate.Candidate> candidates, boolean trim)`
Constructor.
`EntityAttributesPredicate(Collection<EntityAttributesPredicate.Candidate> candidates, boolean trim, boolean all)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Collection<EntityAttributesPredicate.Candidate>`
`getCandidates()`
Get the candidate criteria.
`boolean`
`getMatchAll()`
Get whether all candidates must match.
`boolean`
`getTrimTags()`
Get whether to trim tags for comparison.
`boolean`
`test(EntityDescriptor input)`

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

### log

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

### trimTags

private final boolean trimTags
Whether to trim the values in the metadata before comparison.

### matchAll

private final boolean matchAll
Whether all the candidates must match.

### candidateSet

@Nonnull private final Collection<EntityAttributesPredicate.Candidate> candidateSet
Candidates to check for.

## Constructor Details

### EntityAttributesPredicate

public EntityAttributesPredicate(@Nonnull @ParameterName(name="candidates") Collection<EntityAttributesPredicate.Candidate> candidates)
Constructor.

Parameters:
  `candidates` - the `EntityAttributesPredicate.Candidate` criteria to check for

### EntityAttributesPredicate

public EntityAttributesPredicate(@Nonnull @ParameterName(name="candidates") Collection<EntityAttributesPredicate.Candidate> candidates, @ParameterName(name="trim") boolean trim)
Constructor.

Parameters:
  `candidates` - the `EntityAttributesPredicate.Candidate` criteria to check for
  `trim` - true iff the values found in the metadata should be trimmed before comparison

### EntityAttributesPredicate

public EntityAttributesPredicate(@Nonnull @ParameterName(name="candidates") Collection<EntityAttributesPredicate.Candidate> candidates, @ParameterName(name="trim") boolean trim, @ParameterName(name="all") boolean all)
Constructor.

Parameters:
  `candidates` - the `EntityAttributesPredicate.Candidate` criteria to check for
  `trim` - true iff the values found in the metadata should be trimmed before comparison
  `all` - true iff all the criteria must match to be a successful test

## Method Details

### getTrimTags

public boolean getTrimTags()
Get whether to trim tags for comparison.

Returns:
  true iff tags are to be trimmed for comparison

### getMatchAll

public boolean getMatchAll()
Get whether all candidates must match.

Returns:
  true iff all candidates have to match

### getCandidates

@Nonnull @Unmodifiable @NotLive public Collection<EntityAttributesPredicate.Candidate> getCandidates()
Get the candidate criteria.

Returns:
  the candidate criteria

### test

public boolean test(@Nullable EntityDescriptor input)

Specified by:
  `test` in interface `Predicate<EntityDescriptor>`