Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

danielfariati/cpf-cnpj-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpf-cnpj-validator

Bean Validator de CPF e CNPJ utilizando annotations.

Exemplo de Uso:

public class Person() {
  @Id
  @GeneratedValue
  Long id;
  
  @CPF(required = true) // indica que dado é obrigatório
  String cpf;

  @CNPJ(message = "CNPJ inválido. Por favor, verifique.") // modifica mensagem padrão de erro
  String cnpj;
}

Maven:

<dependency>
  <groupId>com.danielfariati</groupId>
  <artifactId>cpf-cnpj-validator</artifactId>
  <version>1.1</version>
</dependency>

About

Validador de CPF e CNPJ utilizando annotations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages