Interface MergedAnnotationSelector<A extends Annotation>
- Type Parameters:
A- the annotation type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface used to select between two
MergedAnnotation
instances.- Since:
- 5.2
- Author:
- Phillip Webb
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanisBestCandidate(MergedAnnotation<A> annotation) Determine if the existing annotation is known to be the best candidate and any subsequent selections may be skipped.select(MergedAnnotation<A> existing, MergedAnnotation<A> candidate) Select the annotation that should be used.
-
Method Details
-
isBestCandidate
Determine if the existing annotation is known to be the best candidate and any subsequent selections may be skipped.- Parameters:
annotation- the annotation to check- Returns:
trueif the annotation is known to be the best candidate
-
select
Select the annotation that should be used.- Parameters:
existing- an existing annotation returned from an earlier resultcandidate- a candidate annotation that may be better suited- Returns:
- the most appropriate annotation from the
existingorcandidate
-