类 MergedAnnotationCollectors
- java.lang.Object
- org.springframework.core.annotation.MergedAnnotationCollectors
public abstract class MergedAnnotationCollectors extends Object
Collector
implementations that provide various reduction operations forMergedAnnotation
instances.- 从以下版本开始:
- 5.2
- 作者:
- Phillip Webb, Sam Brannen
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <A extends Annotation>
Collector<MergedAnnotation<A>,?,Annotation[]>toAnnotationArray()
Create a newCollector
that accumulates merged annotations to anAnnotation
array containing synthesized versions.static <R extends Annotation,A extends R>
Collector<MergedAnnotation<A>,?,R[]>toAnnotationArray(IntFunction<R[]> generator)
Create a newCollector
that accumulates merged annotations to anAnnotation
array containing synthesized versions.static <A extends Annotation>
Collector<MergedAnnotation<A>,?,Set<A>>toAnnotationSet()
Create a newCollector
that accumulates merged annotations to aLinkedHashSet
containing synthesized versions.static <A extends Annotation>
Collector<MergedAnnotation<A>,?,MultiValueMap<String,Object>>toMultiValueMap(Function<MultiValueMap<String,Object>,MultiValueMap<String,Object>> finisher, MergedAnnotation.Adapt... adaptations)
Create a newCollector
that accumulates merged annotations to aMultiValueMap
with items added from each merged annotation as a map.static <A extends Annotation>
Collector<MergedAnnotation<A>,?,MultiValueMap<String,Object>>toMultiValueMap(MergedAnnotation.Adapt... adaptations)
Create a newCollector
that accumulates merged annotations to aMultiValueMap
with items added from each merged annotation as a map.
方法详细资料
toAnnotationSet
public static <A extends Annotation> Collector<MergedAnnotation<A>,?,Set<A>> toAnnotationSet()
Create a newCollector
that accumulates merged annotations to aLinkedHashSet
containing synthesized versions.The collector returned by this method is effectively equivalent to
Collectors.mapping(MergedAnnotation::synthesize, Collectors.toCollection(LinkedHashSet::new))
but avoids the creation of a composite collector.
toAnnotationArray
public static <A extends Annotation> Collector<MergedAnnotation<A>,?,Annotation[]> toAnnotationArray()
Create a newCollector
that accumulates merged annotations to anAnnotation
array containing synthesized versions.- 类型参数:
A
- the annotation type- 返回:
- a
Collector
which collects and synthesizes the annotations into anAnnotation[]
- 另请参阅:
toAnnotationArray(IntFunction)
toAnnotationArray
public static <R extends Annotation,A extends R> Collector<MergedAnnotation<A>,?,R[]> toAnnotationArray(IntFunction<R[]> generator)
Create a newCollector
that accumulates merged annotations to anAnnotation
array containing synthesized versions.- 类型参数:
A
- the annotation typeR
- the resulting array type- 参数:
generator
- a function which produces a new array of the desired type and the provided length- 返回:
- a
Collector
which collects and synthesizes the annotations into an annotation array - 另请参阅:
toAnnotationArray()
toMultiValueMap
public static <A extends Annotation> Collector<MergedAnnotation<A>,?,MultiValueMap<String,Object>> toMultiValueMap(MergedAnnotation.Adapt... adaptations)
Create a newCollector
that accumulates merged annotations to aMultiValueMap
with items added from each merged annotation as a map.- 类型参数:
A
- the annotation type- 参数:
adaptations
- the adaptations that should be applied to the annotation values- 返回:
- a
Collector
which collects and synthesizes the annotations into aLinkedMultiValueMap
- 另请参阅:
toMultiValueMap(Function, MergedAnnotation.Adapt...)
toMultiValueMap
public static <A extends Annotation> Collector<MergedAnnotation<A>,?,MultiValueMap<String,Object>> toMultiValueMap(Function<MultiValueMap<String,Object>,MultiValueMap<String,Object>> finisher, MergedAnnotation.Adapt... adaptations)
Create a newCollector
that accumulates merged annotations to aMultiValueMap
with items added from each merged annotation as a map.- 类型参数:
A
- the annotation type- 参数:
finisher
- the finisher function for the newMultiValueMap
adaptations
- the adaptations that should be applied to the annotation values- 返回:
- a
Collector
which collects and synthesizes the annotations into aLinkedMultiValueMap
- 另请参阅:
toMultiValueMap(MergedAnnotation.Adapt...)