Пример #1
0
 public static void performAction(Action action) {
   for (Metrics metric : values()) {
     if (metric.isActive()) {
       action.perform(metric);
     }
   }
 }
Пример #2
0
  public static int amountActive() {
    int amount = 0;

    for (Metrics metric : values()) {
      if (metric.isActive()) {
        amount++;
      }
    }

    return amount;
  }