@Override public AnnotationInfoMap apply(List<AnnotationInfo> input) { return AnnotationInfoMap.mapOf(input); } });
public static AnnotationInfoMap mapOf(List<AnnotationInfo> list) { return new AnnotationInfoMap(list); }
public Optional<AnnotationInfo> getAnnotationInfo(Class<?> type) { Optional<AnnotationInfo> res = Optional.absent(); if (type.isAnnotation()) { AnnotationInfoMap annotationInfoMap = annotationInfoMap(); res = annotationInfoMap.get(type); } return res; }
@Override protected AnnotationInfoMap compute() { AnnotationInfoMap map = AnnotationInfoMap.emptyMap(); if (!packageInfo().isJavaLang() && !packageInfo().hasName("java.lang.annotation")) { map = AnnotationMirrorWrapper.wrapAllAndMap(processingEnv(), element()); } return map; } }
private AnnotationInfoMap annotationInfoMap() { List<AnnotationInfo> copyOfAnnotationInfoList = ImmutableList.copyOf(annotationInfoList); return AnnotationInfoMap.mapOf(copyOfAnnotationInfoList); }
@AutoFunctional public boolean hasAnnotation(Class<? extends Annotation> type) { Optional<AnnotationInfo> maybeAnnotation = annotationInfoMap().get(type); return maybeAnnotation.isPresent(); }
@Override public ParameterInfo build() { return ParameterInfo.newPojo() .simpleTypeInfo(simpleTypeInfo) .name(name) .annotationInfoMap(AnnotationInfoMap.mapOf(annotationInfoList)) .build(); }
@AutoFunctional public boolean hasAnnotation(Class<? extends Annotation> annotationType) { return annotationInfoMap().get(annotationType).isPresent(); }
@Override public MethodInfo build() { return MethodInfo.newPojo() .accessInfo(accessInfo) .modifierInfoSet(modifierInfoSet) .name(name) .annotationInfoMap(AnnotationInfoMap.mapOf(annotationInfoList)) .returnTypeInfo(returnTypeInfo) .parameterInfoList(parameterInfoList) .build(); }
@AutoFunctional public boolean hasAnnotation(Class<? extends Annotation> annotationType) { return annotationInfoMap().get(annotationType).isPresent(); }
@Override public TypeInfo build() { return TypeInfo.newPojo() .kind(kind) .packageInfo(packageInfo) .accessInfo(accessInfo) .name(name) .typeParameterInfoMap(TypeParameterInfoMap.mapOf(typeParameterInfoList)) .annotationInfoMap(AnnotationInfoMap.mapOf(annotationInfoList)) .enclosingTypeInfo(Optional.fromNullable(enclosingTypeInfo)) .superTypeInfo(Optional.fromNullable(superTypeInfo)) .interfaceInfoMap(InterfaceInfoMap.mapOf(interfaceInfoList)) .constructorInfoMap(ConstructorInfoMap.mapOf(constructorInfoList)) .methodInfoMap(MethodInfoMap.mapOf(methodInfoList)) .declaredTypeInfoMap(TypeInfoMap.mapOf(declaredTypeInfoList)) .build(); }