All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.portalkit.engines.mailhunter.matcher.PhoneMatcher Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
package net.anotheria.portalkit.engines.mailhunter.matcher;

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

public class PhoneMatcher extends AbstractMatcher{

	private String genericValue;

	private Matcher matcher;

	private Pattern pattern = Pattern.compile("^[0-9]{9,}$");


	public PhoneMatcher(String aValue, double aReduction){
		super(aReduction);
		genericValue = aValue;
	}

	public PhoneMatcher(String aValue){
		this(aValue, 1.0);
	}

	public PhoneMatcher() {
		this("", 1.0);
	}

	@Override public boolean doesMatch(String expression) {
		matcher = pattern.matcher(expression);
		return matcher.matches();
	}
	
	@Override public String toString(){
		return genericValue;
	}
}
 




© 2015 - 2024 Weber Informatics LLC | Privacy Policy