Package org.aoju.bus.core.scanner
Interface SynthesizedSelector
- All Known Implementing Classes:
SynthesizedSelector.FarthestAndNewestPrioritySelector,SynthesizedSelector.FarthestAndOldestPrioritySelector,SynthesizedSelector.NearestAndNewestPrioritySelector,SynthesizedSelector.NearestAndOldestPrioritySelector
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
注解选择器,指定两个注解,选择其中一个返回
该接口用于在
该接口用于在
Synthetic中用于从一批相同的注解对象中筛选最终用于合成注解对象- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class返回距离根对象更远的注解,当距离一样时优先返回新注解static class返回距离根对象更远的注解,当距离一样时优先返回旧注解static class返回距离根对象更近的注解,当距离一样时优先返回新注解static class返回距离根对象更近的注解,当距离一样时优先返回旧注解 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SynthesizedSelector返回距离根对象更远的注解,当距离一样时优先返回新注解static final SynthesizedSelector返回距离根对象更远的注解,当距离一样时优先返回旧注解static final SynthesizedSelector返回距离根对象更近的注解,当距离一样时优先返回新注解static final SynthesizedSelector返回距离根对象更近的注解,当距离一样时优先返回旧注解 -
Method Summary
Modifier and TypeMethodDescription<T extends Synthesized>
Tchoose(T oldAnnotation, T newAnnotation) 比较两个被合成的注解,选择其中的一个并返回
-
Field Details
-
NEAREST_AND_OLDEST_PRIORITY
返回距离根对象更近的注解,当距离一样时优先返回旧注解 -
NEAREST_AND_NEWEST_PRIORITY
返回距离根对象更近的注解,当距离一样时优先返回新注解 -
FARTHEST_AND_OLDEST_PRIORITY
返回距离根对象更远的注解,当距离一样时优先返回旧注解 -
FARTHEST_AND_NEWEST_PRIORITY
返回距离根对象更远的注解,当距离一样时优先返回新注解
-
-
Method Details
-
choose
比较两个被合成的注解,选择其中的一个并返回- Type Parameters:
T- 复合注解类型- Parameters:
oldAnnotation- 已存在的注解,该参数不允许为空newAnnotation- 新获取的注解,该参数不允许为空- Returns:
- 被合成的注解
-