use of com.mercedesbenz.sechub.pds.usecase.PDSUseCaseIdentifier in project sechub by mercedes-benz.
the class UseCaseModel method fetchId.
private UseCaseId fetchId(Class<? extends Annotation> clazz) {
UseCaseId r = new UseCaseId();
Class<? extends Annotation> clazzToFetch = DocReflectionUtil.resolveUnproxiedClass(clazz);
UseCaseDefinition definition = clazzToFetch.getAnnotation(UseCaseDefinition.class);
if (definition != null) {
UseCaseIdentifier ide = definition.id();
r.name = ide.name();
r.uniqueId = ide.uniqueId();
return r;
}
PDSUseCaseDefinition definition2 = clazzToFetch.getAnnotation(PDSUseCaseDefinition.class);
if (definition2 == null) {
throw new IllegalStateException("cannot fetch id from " + clazz);
}
PDSUseCaseIdentifier ide = definition2.id();
r.name = ide.name();
r.uniqueId = ide.uniqueId();
return r;
}
Aggregations