com.happy3w.toolkits.manager.AnnotationDetector Maven / Gradle / Ivy
package com.happy3w.toolkits.manager;
import java.lang.annotation.Annotation;
import java.util.function.Function;
public class AnnotationDetector implements IConfigDetector {
private final Class annType;
private final Function configGenerator;
public AnnotationDetector(Class annType, Function configGenerator) {
this.annType = annType;
this.configGenerator = configGenerator;
}
@Override
public CT detectConfig(Class> dataType) {
AT ann = dataType.getDeclaredAnnotation(annType);
if (ann == null) {
return null;
}
return configGenerator.apply(ann);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy