Top Description Methods
org.springframework.core.annotation

public Interface MergedAnnotationSelector<A extends Annotation>

Known Direct Implementers
org.springframework.core.annotation.MergedAnnotationSelectors.Nearest, org.springframework.core.annotation.MergedAnnotationSelectors.FirstDirectlyDeclared
Annotations
@FunctionalInterface
Type Parameters
<A>
the annotation type
Imports
java.lang.annotation.Annotation

Strategy interface used to select between two MergedAnnotation instances.
Author
Phillip Webb
Since
5.2
See Also
MergedAnnotationSelectors

Method Summary

Modifier and TypeMethod and Description
public default boolean

Returns:

true if the annotation is known to be the best candidate
isBestCandidate
(MergedAnnotation<A>
the annotation to check
annotation
)

Determine if the existing annotation is known to be the best candidate and any subsequent selections may be skipped.

public MergedAnnotation<A>

Returns:

the most appropriate annotation from the existing or candidate
select
(MergedAnnotation<A>
an existing annotation returned from an earlier result
existing
,
MergedAnnotation<A>
a candidate annotation that may be better suited
candidate
)

Select the annotation that should be used.

Method Detail

isBestCandidateback to summary
public default boolean isBestCandidate(MergedAnnotation<A> annotation)

Determine if the existing annotation is known to be the best candidate and any subsequent selections may be skipped.

Parameters
annotation:MergedAnnotation<A>

the annotation to check

Returns:boolean

true if the annotation is known to be the best candidate

selectback to summary
public MergedAnnotation<A> select(MergedAnnotation<A> existing, MergedAnnotation<A> candidate)

Select the annotation that should be used.

Parameters
existing:MergedAnnotation<A>

an existing annotation returned from an earlier result

candidate:MergedAnnotation<A>

a candidate annotation that may be better suited

Returns:MergedAnnotation<A>

the most appropriate annotation from the existing or candidate