Polish RuntimeHintsPredicates
This commit adds a method variant checking that all `MemberCategory` are supported by the `RuntimeHints` for a given type hint. See gh-28555
This commit is contained in:
@@ -180,6 +180,16 @@ public class ReflectionHintsPredicates {
|
||||
return this.and(hints -> getTypeHint(hints).getMemberCategories().contains(memberCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* Refine the current predicate to only match if the given {@link MemberCategory categories} are present.
|
||||
* @param memberCategories the member categories
|
||||
* @return the refined {@link RuntimeHints} predicate
|
||||
*/
|
||||
public Predicate<RuntimeHints> withMemberCategories(MemberCategory... memberCategories) {
|
||||
Assert.notEmpty(memberCategories, "'memberCategories' should not be empty");
|
||||
return this.and(hints -> getTypeHint(hints).getMemberCategories().containsAll(Arrays.asList(memberCategories)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Refine the current predicate to match if any of the given {@link MemberCategory categories} is present.
|
||||
* @param memberCategories the member categories
|
||||
|
||||
Reference in New Issue
Block a user