@SuppressWarnings("unchecked") @Override public <T extends Annotation> T[] synthesizeAnnotationsByType(Class<T> annotationClass) { if (annotationClass != null) { List<AnnotationValue<T>> values = getAnnotationValuesByType(annotationClass); return values.stream() .map(entries -> AnnotationMetadataSupport.buildAnnotation(annotationClass, entries.getConvertibleValues())) .toArray(value -> (T[]) Array.newInstance(annotationClass, value)); } //noinspection unchecked return (T[]) AnnotationUtil.ZERO_ANNOTATIONS; }
@Override public <T extends Annotation> T[] synthesizeDeclaredAnnotationsByType(Class<T> annotationClass) { if (annotationClass != null) { List<AnnotationValue<T>> values = getAnnotationValuesByType(annotationClass); return values.stream() .map(entries -> AnnotationMetadataSupport.buildAnnotation(annotationClass, entries.getConvertibleValues())) .toArray(value -> (T[]) Array.newInstance(annotationClass, value)); } //noinspection unchecked return (T[]) AnnotationUtil.ZERO_ANNOTATIONS; }
@Override public <T extends Annotation> T[] synthesizeDeclaredAnnotationsByType(Class<T> annotationClass) { if (annotationClass != null) { List<AnnotationValue<T>> values = getAnnotationValuesByType(annotationClass); return values.stream() .map(entries -> AnnotationMetadataSupport.buildAnnotation(annotationClass, entries.getConvertibleValues())) .toArray(value -> (T[]) Array.newInstance(annotationClass, value)); } //noinspection unchecked return (T[]) AnnotationUtil.ZERO_ANNOTATIONS; }
@SuppressWarnings("unchecked") @Override public <T extends Annotation> T[] synthesizeAnnotationsByType(Class<T> annotationClass) { if (annotationClass != null) { List<AnnotationValue<T>> values = getAnnotationValuesByType(annotationClass); return values.stream() .map(entries -> AnnotationMetadataSupport.buildAnnotation(annotationClass, entries.getConvertibleValues())) .toArray(value -> (T[]) Array.newInstance(annotationClass, value)); } //noinspection unchecked return (T[]) AnnotationUtil.ZERO_ANNOTATIONS; }