Package net.datafaker.idnumbers.pt.br
Class IdNumberGeneratorPtBrUtil
java.lang.Object
net.datafaker.idnumbers.pt.br.IdNumberGeneratorPtBrUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcnpj(BaseProviders faker, boolean formatted, boolean valid, boolean multiBranch) static Stringcpf(BaseProviders faker, boolean formatted, boolean valid) static booleanisCNPJValid(String cnpj) Return true if the CNPJ is valid A valid CNPJ is unique and have an algorithm to validate itstatic BooleanisCPFValid(String cpf) Return true if the CPF is valid A valid CPF is unique and have a algorithm to validate it
-
Method Details
-
cnpj
public static String cnpj(BaseProviders faker, boolean formatted, boolean valid, boolean multiBranch) - Parameters:
formatted- a cnpj (un)formattedvalid- a cnpj (in)valid
-
cpf
- Parameters:
formatted- a CPF (un)formattedvalid- a CPF (in)valid
-
isCNPJValid
Return true if the CNPJ is valid A valid CNPJ is unique and have an algorithm to validate itCNPJ generator could generate a valid or invalid because, sometimes, we need to test a registration with invalid number
-
isCPFValid
Return true if the CPF is valid A valid CPF is unique and have a algorithm to validate itCPF generator could generate a valid or invalid because, sometimes, we need to test a registration with invalid number
-