avraampiperidis / speechai

side project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Phone parser lib

Actions Status

Library usage

Set<NumberRes> res = new PhoneGeneratorBuilder()
    .with("00 30 697 111 11 11")
	.skipGreekPhoneValidation(true).generate();
	//NumberRes.getPhone() : String
	//NumberRes.isValid() : boolean

Compile and run tests

git clone https://github.com/avraampiperidis/speechai.git
cd speechai
mvn compile
mvn test
//To run the demo Main class provided
cd numberchecker
mvn exec:java -Dexec.mainClass="com.omilia.it.runner.MainDemo"

Standalone validators usage

SimpleConstraintViolationException ex = new ValidationContext(new PhoneNumberValidator
                .ValidateGreekPhoneNumber(null,"6559884"),ValidationContext.DispatchOnFail.YES)
                .and(new PhoneNumberValidator
                .ValidateGreekPhoneNumber(null,"5545sdfas555"))
                .checkValidation();
assertEquals(2,ex.getErrors().size());

Packages

//for base usage
com.omilia.it.core.*
//for standalone validators
com.omilia.it.validation.*

About

side project


Languages

Language:Java 100.0%