|
| 1 | +> [!NOTE] |
| 2 | +> I accept help to make the version of the other programming languages. |
| 3 | +
|
| 4 | +# Multiform-validator |
| 5 | + |
| 6 | +## JAVA >=8 |
| 7 | + |
| 8 | +## Official Website |
| 9 | + |
| 10 | +- [Multiform Validator - Website](https://multiformvalidator.netlify.app/documentation) |
| 11 | + |
| 12 | +## Source code |
| 13 | + |
| 14 | +- [Multiform-Validator](https://github.com/Multiform-Validator/java/) |
| 15 | + |
| 16 | +## 📦 Download / Installation |
| 17 | + |
| 18 | +follow the steps below to use the library in your project. |
| 19 | + |
| 20 | +- [jitpack.io](https://jitpack.io/#Multiform-Validator/java) - Multiform Validator |
| 21 | + |
| 22 | +<details> |
| 23 | + <summary>Gradle</summary> |
| 24 | + |
| 25 | +Step 1. Add the JitPack repository to your build file |
| 26 | + |
| 27 | +Add it in your root build.gradle at the end of repositories: |
| 28 | + |
| 29 | +```gradle |
| 30 | +dependencyResolutionManagement { |
| 31 | + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) |
| 32 | + repositories { |
| 33 | + mavenCentral() |
| 34 | + maven { url 'https://jitpack.io' } |
| 35 | + } |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +Step 2. Add the dependency |
| 40 | + |
| 41 | +```gradle |
| 42 | +dependencies { |
| 43 | + implementation 'com.github.Multiform-Validator:java:0.0.4' |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +</details> |
| 48 | + |
| 49 | +<details> |
| 50 | + <summary>Maven</summary> |
| 51 | + |
| 52 | +Step 1. Add the JitPack repository to your build file |
| 53 | + |
| 54 | +```xml |
| 55 | + |
| 56 | +<repositories> |
| 57 | + <repository> |
| 58 | + <id>jitpack.io</id> |
| 59 | + <url>https://jitpack.io</url> |
| 60 | + </repository> |
| 61 | +</repositories> |
| 62 | +``` |
| 63 | + |
| 64 | +Step 2. Add the dependency |
| 65 | + |
| 66 | +```xml |
| 67 | + |
| 68 | +<dependency> |
| 69 | + <groupId>com.github.Multiform-Validator</groupId> |
| 70 | + <artifactId>java</artifactId> |
| 71 | + <version>0.0.4</version> |
| 72 | +</dependency> |
| 73 | +``` |
| 74 | + |
| 75 | +</details> |
| 76 | + |
| 77 | +<details> |
| 78 | + <summary>Sbt</summary> |
| 79 | + |
| 80 | +Step 1. Add the JitPack repository to your build file |
| 81 | + |
| 82 | +Add it in your build.sbt at the end of resolvers: |
| 83 | + |
| 84 | +```sbt |
| 85 | +resolvers += "jitpack" at "https://jitpack.io" |
| 86 | +``` |
| 87 | + |
| 88 | +Step 2. Add the dependency |
| 89 | + |
| 90 | +```sbt |
| 91 | +libraryDependencies += "com.github.Multiform-Validator" % "java" % "0.0.4" |
| 92 | +``` |
| 93 | + |
| 94 | +</details> |
| 95 | + |
| 96 | +<details> |
| 97 | + <summary>Leiningen</summary> |
| 98 | + |
| 99 | +Step 1. Add the JitPack repository to your build file |
| 100 | + |
| 101 | +Add it in your project.clj at the end of repositories: |
| 102 | + |
| 103 | +```clojure |
| 104 | +:repositories [["jitpack" "https://jitpack.io"]] |
| 105 | +``` |
| 106 | + |
| 107 | +Step 2. Add the dependency |
| 108 | + |
| 109 | +```clojure |
| 110 | +:dependencies [[com.github.Multiform-Validator/java "0.0.4"]] |
| 111 | +``` |
| 112 | + |
| 113 | +</details> |
| 114 | + |
| 115 | +## Available methods - JAVA (0.0.4)v |
| 116 | + |
| 117 | +- [CnpjValidator](https://multiform-validator.github.io/java/classes/CnpjValidator) |
| 118 | + |
| 119 | +- [CpfValidator](https://multiform-validator.github.io/java/classes/CpfValidator) |
| 120 | + |
| 121 | +- [CreditCardValidator](https://multiform-validator.github.io/java/classes/CreditCardValidator) |
| 122 | + |
| 123 | +- [FileValidator](https://multiform-validator.github.io/java/classes/FileValidator) |
| 124 | + |
| 125 | +- [Utils](https://multiform-validator.github.io/java/classes/Utils) |
| 126 | + |
| 127 | +- [Validate](https://multiform-validator.github.io/java/classes/Validate) |
| 128 | + |
| 129 | +- [Validator](https://multiform-validator.github.io/java/classes/Validator) |
| 130 | + |
| 131 | +## Example how to use |
| 132 | + |
| 133 | +### CnpjValidator |
| 134 | + |
| 135 | +```java |
| 136 | +// You can import the class or use the full path |
| 137 | + |
| 138 | +import io.github.multiform_validator.CnpjValidator; |
| 139 | + |
| 140 | +public class Main { |
| 141 | + public static void main(String[] args) { |
| 142 | + String cnpjTrue = "69.807.668/0001-41"; |
| 143 | + String cnpjFalse = "61.807.661/0001-48"; |
| 144 | + System.out.println(CnpjValidator.cnpjIsValid(cnpjTrue)); // true |
| 145 | + System.out.println(CnpjValidator.cnpjIsValid(cnpjFalse)); // false |
| 146 | + } |
| 147 | +} |
| 148 | +``` |
0 commit comments