Class Cnpj

java.lang.Object
br.com.intersys.systextil.util.Cnpj
All Implemented Interfaces:
Comparable<Cnpj>

@Deprecated(forRemoval=true) public class Cnpj extends Object implements Comparable<Cnpj>
Deprecated, for removal: This API element is subject to removal in a future version.
Essa classe não deve mais ser usada, pois representa um CNPJ numérico. Use CNPJ.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final TempConverter<Cnpj,Integer[]>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Conversor usado nos cadastros de registros temporários para filtros em relatórios.
    static final Cnpj
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Cnpj(int cgc9, int cgc4, int cgc2)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Este método não pode ser sobrescrito, pois comparações de instâncias deste tipo devem ser compatíveis com Cnpj.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Se cgc4 for zero, formata como CPF; caso contário, como CNPJ.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Formata como um CNPJ: 50.464.734/0001-08
    Deprecated, for removal: This API element is subject to removal in a future version.
    Formata como um CPF: 751.280.989-74
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static Cnpj
    parse(String string)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Obtém um Cnpj a partir de um CPF ou CNPJ.
    static Cnpj
    Deprecated, for removal: This API element is subject to removal in a future version.
    Obtém um Cnpj a partir de um CNPJ formatado como CNPJ (por exemplo 12.345.678/0001-35) - com algumas tolerâncias.
    static Cnpj
    Deprecated, for removal: This API element is subject to removal in a future version.
    Obtém um Cnpj a partir de um CPF formatado como CPF (por exemplo 123.456.789-35) - com algumas tolerâncias.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Utilidade para obter um CNPJ alfanumérico.
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • TEMP_CONVERTER

      public static final TempConverter<Cnpj,Integer[]> TEMP_CONVERTER
      Deprecated, for removal: This API element is subject to removal in a future version.
      Conversor usado nos cadastros de registros temporários para filtros em relatórios.
    • ZEROS

      public static final Cnpj ZEROS
      Deprecated, for removal: This API element is subject to removal in a future version.
    • cgc9

      public final int cgc9
      Deprecated, for removal: This API element is subject to removal in a future version.
    • cgc4

      public final int cgc4
      Deprecated, for removal: This API element is subject to removal in a future version.
    • cgc2

      public final int cgc2
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • Cnpj

      public Cnpj(int cgc9, int cgc4, int cgc2)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Object
    • isPessoaFisica

      public boolean isPessoaFisica()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object
    • parseCNPJ

      public static Cnpj parseCNPJ(String cnpj) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Obtém um Cnpj a partir de um CNPJ formatado como CNPJ (por exemplo 12.345.678/0001-35) - com algumas tolerâncias. Os pontos não são necessários, nem zeros à esquerda. Se não tiver delimitadores, deve conter 14 dígitos. Espaços ao redor são desconsiderados.
      Returns:
      o Cnpj correspondente ao CNPJ, ou nulo se estiver nulo ou vazio
      Throws:
      IllegalArgumentException - se não estiver em um formato válido
    • parseCPF

      public static Cnpj parseCPF(String cpf) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Obtém um Cnpj a partir de um CPF formatado como CPF (por exemplo 123.456.789-35) - com algumas tolerâncias. Os pontos não são necessários, nem zeros à esquerda, e o delimitador pode ser hífen ou barra. Se não tiver delimitadores, deve conter 11 dígitos. Espaços ao redor são desconsiderados.
      Returns:
      o Cnpj correspondente ao CNPJ, ou nulo se estiver nulo ou vazio
      Throws:
      IllegalArgumentException - se não estiver em um formato válido
    • parse

      public static Cnpj parse(String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Obtém um Cnpj a partir de um CPF ou CNPJ. Primeiro tenta parseCNPJ(java.lang.String), e, se não funcionar, tenta parseCPF(java.lang.String).
      Returns:
      o Cnpj correspondente, ou nulo se estiver nulo ou vazio
      Throws:
      IllegalArgumentException - se não estiver em um formato válido
    • formatCNPJ

      public String formatCNPJ()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Formata como um CNPJ: 50.464.734/0001-08
    • formatCPF

      public String formatCPF()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Formata como um CPF: 751.280.989-74
    • format

      public String format()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Se cgc4 for zero, formata como CPF; caso contário, como CNPJ.
    • compareTo

      public final int compareTo(Cnpj o)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Este método não pode ser sobrescrito, pois comparações de instâncias deste tipo devem ser compatíveis com Cnpj.
      Specified by:
      compareTo in interface Comparable<Cnpj>
    • toNew

      public CNPJ toNew()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Utilidade para obter um CNPJ alfanumérico.
      Returns:
      o CNPJ alfanumérico correspondente a este CNPJ