Class SynthesizedSelector.NearestAndNewestPrioritySelector

java.lang.Object
org.aoju.bus.core.scanner.SynthesizedSelector.NearestAndNewestPrioritySelector
All Implemented Interfaces:
SynthesizedSelector
Enclosing interface:
SynthesizedSelector

public static class SynthesizedSelector.NearestAndNewestPrioritySelector extends Object implements SynthesizedSelector
返回距离根对象更近的注解,当距离一样时优先返回新注解
  • Constructor Details

    • NearestAndNewestPrioritySelector

      public NearestAndNewestPrioritySelector()
  • Method Details

    • choose

      public <T extends Synthesized> T choose(T oldAnnotation, T newAnnotation)
      Description copied from interface: SynthesizedSelector
      比较两个被合成的注解,选择其中的一个并返回
      Specified by:
      choose in interface SynthesizedSelector
      Type Parameters:
      T - 复合注解类型
      Parameters:
      oldAnnotation - 已存在的注解,该参数不允许为空
      newAnnotation - 新获取的注解,该参数不允许为空
      Returns:
      被合成的注解