package com.beantimer.model;

/**
 *
 */
public class ProcessedMetric {


    public final static String TOTAL_BEAN_NAME = "Total";
    public final static String TOTAL_BEAN_TYPE = "";
    public final static String TOTAL_BEAN_SCOPE = "";
    public final static boolean TOTAL_PRIMARY = false;

    final private String beanName;
    final private String beanType;
    final private String beanScope;
    final private boolean primaryBean;
    final private Double durationAvg;
    final private Long durationMin;
    final private Long durationMax;
    final private Long count;

    public ProcessedMetric(String beanName, String beanType, String beanScope, boolean primaryBean, Double durationAvg, Long durationMin, Long durationMax, Long count) {
        this.beanName = beanName;
        this.beanType = beanType;
        this.beanScope = beanScope;
        this.primaryBean = primaryBean;
        this.durationAvg = durationAvg;
        this.durationMin = durationMin;
        this.durationMax = durationMax;
        this.count = count;
    }


    public String getBeanName() {
        return beanName;
    }

    public String getBeanType() {
        return beanType;
    }

    public String getBeanScope() {
        return beanScope;
    }

    public boolean isPrimaryBean() {
        return primaryBean;
    }

    public Double getDurationAvg() {
        return durationAvg;
    }

    public Long getDurationMin() {
        return durationMin;
    }

    public Long getDurationMax() {
        return durationMax;
    }

    public Long getCount() {
        return count;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("ProcessedMetric{");
        sb.append("beanName='").append(beanName).append('\'');
        sb.append(", beanType='").append(beanType).append('\'');
        sb.append(", beanScope='").append(beanScope).append('\'');
        sb.append(", primaryBean=").append(primaryBean);
        sb.append(", durationAvg=").append(durationAvg);
        sb.append(", durationMin=").append(durationMin);
        sb.append(", durationMax=").append(durationMax);
        sb.append(", count=").append(count);
        sb.append('}');
        return sb.toString();
    }
}

@@ -1643,283 +1643,194 @@
     
-final StringBuffer sb = new StringBuffer(%22ProcessedMetric%7B%22);%0A        sb.append(%22beanName='%22).append(beanName).append('%5C'');%0A        sb.append(%22, beanType='%22).append(beanType).append('%5C'');%0A        sb.append(%22, beanScope='%22).append(beanScope).append('%5C'');%0A        sb.append(
+String sb = %22ProcessedMetric%7B%22 + %22beanName='%22 + beanName + '%5C'' +%0A                %22, beanType='%22 + beanType + '%5C'' +%0A                %22, beanScope='%22 + beanScope + '%5C'' +%0A                
 %22, p
@@ -1841,25 +1841,19 @@
 ryBean=%22
-).append(
+ + 
 primaryB
@@ -1855,18 +1855,18 @@
 maryBean
-);
+ +
 %0A       
@@ -1862,34 +1862,32 @@
 n +%0A        
-sb.append(
+        
 %22, durationA
@@ -1890,25 +1890,19 @@
 ionAvg=%22
-).append(
+ + 
 duration
@@ -1904,37 +1904,35 @@
 ationAvg
-);%0A        sb.append(
+ +%0A                
 %22, durat
@@ -1939,25 +1939,19 @@
 ionMin=%22
-).append(
+ + 
 duration
@@ -1953,18 +1953,18 @@
 ationMin
-);
+ +
 %0A       
@@ -1964,26 +1964,24 @@
         
-sb.append(
+        
 %22, durat
@@ -1988,25 +1988,19 @@
 ionMax=%22
-).append(
+ + 
 duration
@@ -2002,37 +2002,35 @@
 ationMax
-);%0A        sb.append(
+ +%0A                
 %22, count
@@ -2035,24 +2035,18 @@
 nt=%22
-).append(
+ + 
 count
-);
+ +
 %0A   
@@ -2054,22 +2054,19 @@
     
-sb.append(
+        
 '%7D'
-)
 ;%0A  
@@ -2084,19 +2084,8 @@
 n sb
-.toString()
 ;%0A  

Replace StringBuilder