package com.timgroup.status;

import com.yammer.metrics.core.Gauge;

public class ThresholdedGaugeComponent<T extends Comparable<T>> extends GaugeComponent<T> {
    
    private final T warningThreshold;
    private final T criticalThreshold;
    
    public ThresholdedGaugeComponent(String id, String label, Gauge<T> gauge, T warningThreshold, T criticalThreshold) {
        super(id, label, gauge);
        this.warningThreshold = warningThreshold;
        this.criticalThreshold = criticalThreshold;
    }
    
    @Override
    protected Status getStatus(T value) {
        if (value.compareTo(criticalThreshold) > 0) {
            return Status.CRITICAL;
        } else if (value.compareTo(warningThreshold) > 0) {
            return Status.WARNING;
        } else {
            return Status.OK;
        }
    }
    
}

@@ -663,21 +663,24 @@
        %7D
- else
+%0A       
  if (val
@@ -765,20 +765,9 @@
    %7D
- else %7B%0A    
+%0A
     
@@ -788,26 +788,16 @@
 tus.OK;%0A
-        %7D%0A
     %7D%0A  

remove unnecessary else blocks