package ua.avk.rest.service.util;

import ua.avk.rest.entity.Contact;

import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Alex Kononenko
 * @version 1.0.0
 *
 * Filter class
 */
public class Filter {
    private Pattern pattern;
    private Matcher matcher;

    /**
     *
     * @param regExp string
     */
    public Filter(String regExp){
        pattern = Pattern.compile(regExp);
    }

    /**
     * Check validation string with regular expression
     *
     * @param contact string
     * @return true or false
     */
    public boolean getFilter(String contact){
        matcher = pattern.matcher(contact);
        if (matcher.matches()){
            return true;
        } else {
            return false;
        }
    }


}

@@ -34,70 +34,8 @@
 %0D%0A%0D%0A
-import ua.avk.rest.entity.Contact;%0D%0A%0D%0Aimport java.util.List;%0D%0A
 impo
@@ -151,20 +151,43 @@
 .0.0%0D%0A *
-%0D%0A *
+          %3Cp/%3E%0D%0A *         
  Filter 
@@ -292,24 +292,16 @@
    /**%0D%0A
-     *%0D%0A
      * @
@@ -362,16 +362,17 @@
  regExp)
+ 
 %7B%0D%0A     
@@ -605,16 +605,17 @@
 contact)
+ 
 %7B%0D%0A     
@@ -684,16 +684,17 @@
 tches())
+ 
 %7B%0D%0A     
@@ -727,28 +727,18 @@
    %7D
- else %7B%0D%0A   
+%0D%0A
         
  ret
@@ -729,25 +729,24 @@
  %7D%0D%0A        
- 
 return false
@@ -744,35 +744,24 @@
 urn false;%0D%0A
-        %7D%0D%0A
     %7D%0D%0A%0D%0A%0D%0A%7D

Update Filter.java