Class DefaultControlSelectionFilter
- java.lang.Object
-
- gov.nist.secauto.oscal.lib.profile.resolver.selection.DefaultControlSelectionFilter
-
- All Implemented Interfaces:
IControlSelectionFilter
,Function<IControl,org.apache.commons.lang3.tuple.Pair<Boolean,Boolean>>
public class DefaultControlSelectionFilter extends Object implements IControlSelectionFilter
-
-
Field Summary
-
Fields inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.selection.IControlSelectionFilter
ALL_MATCH, MATCH, NON_MATCH, NONE_MATCH
-
-
Constructor Summary
Constructors Constructor Description DefaultControlSelectionFilter(List<? extends IProfileSelectControlById> selections)
Construct a new selection filter based on the provided list of select criteria.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.lang3.tuple.Pair<Boolean,Boolean>
apply(IControl control)
Determines if the control is matched by this filter.protected org.apache.commons.lang3.tuple.Pair<Boolean,Boolean>
match(String id)
Checks if the provided control identifier matches the criteria defined by this object.
-
-
-
Constructor Detail
-
DefaultControlSelectionFilter
public DefaultControlSelectionFilter(@NonNull List<? extends IProfileSelectControlById> selections)
Construct a new selection filter based on the provided list of select criteria.- Parameters:
selections
- a list of select criteria
-
-
Method Detail
-
apply
@NonNull public org.apache.commons.lang3.tuple.Pair<Boolean,Boolean> apply(IControl control)
Description copied from interface:IControlSelectionFilter
Determines if the control is matched by this filter. This method returns aPair
where the first member of the pair indicates if the control matches, and the second indicates if the match applies to child controls as well.- Specified by:
apply
in interfaceFunction<IControl,org.apache.commons.lang3.tuple.Pair<Boolean,Boolean>>
- Specified by:
apply
in interfaceIControlSelectionFilter
- Parameters:
control
- the control to check for a match- Returns:
- a pair indicating the status of the match (
true
for a match orfalse
otherwise), and if a match applies to child controls
-
match
@NonNull protected org.apache.commons.lang3.tuple.Pair<Boolean,Boolean> match(String id)
Checks if the provided control identifier matches the criteria defined by this object.- Parameters:
id
- the control identifier to match- Returns:
- a
Pair
whose first member istrue
for a match orfalse
otherwise, and whose second member istrue
if the match applies to any child controls orfalse
otherwise
-
-