use of com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseDefinition in project sechub by mercedes-benz.
the class RestDocFactory method createDescription.
public static String createDescription(Class<? extends Annotation> useCase) {
UseCaseDefinition usecaseAnnotation = useCase.getAnnotation(UseCaseDefinition.class);
StringBuilder sb = new StringBuilder();
if (usecaseAnnotation == null) {
throw new IllegalArgumentException("given use case must have annotation of use case defintiion inside but hasnot :" + useCase);
} else {
String description = usecaseAnnotation.description();
if (description.contains(".adoc")) {
sb.append(usecaseAnnotation.title());
} else {
sb.append(description);
}
}
return sb.toString();
}
use of com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseDefinition in project sechub by mercedes-benz.
the class RestDocFactory method createIdentifier.
public static String createIdentifier(Class<? extends Annotation> useCase) {
UseCaseDefinition usecaseAnnotation = useCase.getAnnotation(UseCaseDefinition.class);
if (usecaseAnnotation == null) {
throw new IllegalArgumentException("given use case must have annotation of use case definition inside but has not: " + useCase);
}
String usecaseIdentifier = usecaseAnnotation.apiName();
if (usecaseIdentifier == null) {
throw new IllegalArgumentException("use case annotation of class does not contain id:" + useCase);
}
return usecaseIdentifier;
}
Aggregations