/[projects]/miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/notification/NotiferHelper.java
ViewVC logotype

Contents of /miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/notification/NotiferHelper.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2449 - (show annotations) (download)
Fri Mar 20 08:58:46 2015 UTC (9 years, 3 months ago) by torben
File size: 579 byte(s)
switch to maven
1 package dk.thoerup.circuitbreaker.notification;
2
3 public class NotiferHelper {
4 public static String getName(Notifier notif) {
5 StringBuilder sb = new StringBuilder();
6 sb.append(notif.getClass().getSimpleName());
7
8 if (notif instanceof CompositeNotifier) {
9 CompositeNotifier composite = (CompositeNotifier) notif;
10 sb.append("(");
11 for (int i=0; i<composite.children.size(); i++) {
12 Notifier n = composite.children.get(i);
13
14 if (i > 0) {
15 sb.append(",");
16 }
17 sb.append( getName(n) );
18 }
19 sb.append(")");
20 }
21
22 return sb.toString();
23 }
24 }

  ViewVC Help
Powered by ViewVC 1.1.20