@@ -0,0 +1,2117 @@
+package handler;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0A/**%0A * Created by neiro on 22.05.17.%0A */%0Apublic class ParseHandler %7B%0A%0A    private static final Logger logger = LoggerFactory.getLogger(ParseHandler.class);%0A%0A    private List%3CString%3E lines = new ArrayList();%0A%0A%0A    public ParseHandler(final List lines) %7B%0A        this.lines = lines;%0A    %7D%0A%0A    public int handle(String grepType, String%5B%5D grepStrings, boolean useCaseSensitivity) %7B%0A        if ( grepType.equals(%22grep%22))%0A           return handleByGrep(grepStrings, useCaseSensitivity);%0A%0A        logger.debug(%22Handle method return -1. Always is mean that command%22%0A                + %22 not supported. In your case the command is %7B%7D%22, grepType);%0A        return -1;%0A    %7D%0A%0A    //type, array, use_case_sensitivity%0A    //%22grep%22, a%5B%22com.apple%22,%22mdworker%22, %22Pushing respawn%22%5D, false%0A%0A    /**%0A     * Handle log lines by grep. All lines from grepStrings array must be matched%0A     * @param grepStrings matched strings%0A     * @param useCaseSensitivity set to false if method must be compare all words from line as lower cased%0A     * @return number of lines found%0A     */%0A    private int handleByGrep(String%5B%5D grepStrings, boolean useCaseSensitivity) %7B%0A%0A        logger.info(%22Try to find: %7B%7D%22, Arrays.toString(grepStrings));%0A%0A        String sourceStr;%0A        int linesCount = 0;%0A        int grepCount;%0A        for (int i = 0; i %3C lines.size(); i++) %7B%0A            grepCount = 0;%0A            if (! useCaseSensitivity )%0A                sourceStr = lines.get(i).toLowerCase();%0A            else%0A                sourceStr = lines.get(i);%0A%0A            for (int j = 0; j %3C grepStrings.length; j++) %7B%0A                if ( ! sourceStr.contains(grepStrings%5Bj%5D.toLowerCase()) ) %7B%0A                    continue;%0A                %7D%0A                grepCount++;%0A            %7D%0A%0A%0A            if ( grepCount == grepStrings.length ) %7B%0A                logger.debug(%22%254d %25d  =%3E  %25s%5Cn%22, i, grepCount, sourceStr);%0A                linesCount++;%0A            %7D%0A%0A        %7D%0A%0A        return linesCount;%0A    %7D%0A%0A%7D%0A

Rename GrepHandler to ParseHandler