MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / trackUseCases

Method trackUseCases

annotations/UseCaseTracker.java:10–22  ·  view source on GitHub ↗
(List<Integer> useCases, Class<?> cl)

Source from the content-addressed store, hash-verified

8
9public class UseCaseTracker {
10 public static void
11 trackUseCases(List<Integer> useCases, Class<?> cl) {
12 for(Method m : cl.getDeclaredMethods()) {
13 UseCase uc = m.getAnnotation(UseCase.class);
14 if(uc != null) {
15 System.out.println("Found Use Case " +
16 uc.id() + "\n " + uc.description());
17 useCases.remove(Integer.valueOf(uc.id()));
18 }
19 }
20 useCases.forEach(i ->
21 System.out.println("Missing use case " + i));
22 }
23 public static void main(String[] args) {
24 List<Integer> useCases = IntStream.range(47, 51)
25 .boxed().collect(Collectors.toList());

Callers 1

mainMethod · 0.95

Calls 2

idMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected