package com.wizzardo.http.utils;

import com.wizzardo.tools.misc.ExceptionDrivenStringBuilder;
import com.wizzardo.tools.misc.SoftThreadLocal;

/**
 * Created by wizzardo on 16.01.15.
 */
public class StringBuilderThreadLocalHolder {

    protected final SoftThreadLocal<ExceptionDrivenStringBuilder> stringBuilder = new SoftThreadLocal<ExceptionDrivenStringBuilder>() {
        @Override
        protected ExceptionDrivenStringBuilder init() {
            return new ExceptionDrivenStringBuilder();
        }

        @Override
        public ExceptionDrivenStringBuilder getValue() {
            ExceptionDrivenStringBuilder builder = super.getValue();
            builder.setLength(0);
            return builder;
        }
    };

    public ExceptionDrivenStringBuilder get() {
        return stringBuilder.getValue();
    }
}

@@ -334,215 +334,70 @@
 cal%3C
-ExceptionDrivenStringBuilder%3E() %7B%0A        @Override%0A        protected ExceptionDrivenStringBuilder init() %7B%0A            return new ExceptionDrivenStringBuilder();
+%3E(%0A            ExceptionDrivenStringBuilder::new,
 %0A      
-  %7D%0A%0A
       
-  @Override%0A        public 
 Exce
@@ -424,168 +424,21 @@
 lder
- getValue() %7B%0A            ExceptionDrivenStringBuilder builder = super.getValue();%0A            builder.setLength(0);%0A            return builder;%0A        %7D%0A    %7D
+::clear%0A    )
 ;%0A%0A 

update after last changes in tools-lib