https://github.com/enesusta/turkish-citizen-validator
This repository validates Turkish citizen number using SOAP Protocol
https://github.com/enesusta/turkish-citizen-validator
Last synced: 3 days ago
JSON representation
This repository validates Turkish citizen number using SOAP Protocol
- Host: GitHub
- URL: https://github.com/enesusta/turkish-citizen-validator
- Owner: enesusta
- Created: 2020-03-01T13:23:22.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-02T08:36:50.000Z (about 5 years ago)
- Last Synced: 2024-11-07T12:41:53.605Z (5 months ago)
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - enesusta/turkish-citizen-validator - This repository validates Turkish citizen number using SOAP Protocol (Java)
README
[](http://search.maven.org/artifact/com.github.enesusta/turkish-citizen-validator)
[](https://github.com/enesusta/turkish-citizen-validator/issues)##### Quick Installation
If you are using **Maven** you can add the repository by adding the following XML to your project `pom.xml` file.
```xml
com.github.enesusta
turkish-citizen-validator
1.3.3```
##### How can I use it?
Validator is based on two components.
- Citizen
- CitizenValidator##### Citizen
You can create **a Citizen object** in two ways.
- The first of these and recommended way is:
Use `CitizenBuilder`
```java
import com.github.enesusta.soap.builder.CitizenBuilder;
import com.github.enesusta.soap.domain.Citizen;public class Tutorial {
public static void main(String[] args) {Citizen citizen = CitizenBuilder
.getInstance()
.setId(12345678910L)
.setName("Enes")
.setSurname("Usta")
.setBirthYear(1998)
.build();}
}
```ID must be 11 digits long type
- Another way is (not recommended):
```java
import com.github.enesusta.soap.domain.Citizen;public class Tutorial {
public static void main(String[] args) {
Citizen citizen = new Citizen(12345678910L, "Enes", "Usta", 1998);
}
}
```##### CitizenValidator
It's easy to use. Just follow the code.
```java
import com.github.enesusta.soap.builder.CitizenBuilder;
import com.github.enesusta.soap.domain.Citizen;
import com.github.enesusta.soap.validator.CitizenValidator;
import com.github.enesusta.soap.validator.DefaultCitizenValidator;public class Tutorial {
public static void main(String[] args) {Citizen citizen = CitizenBuilder
.getInstance()
.setId(12345678910L)
.setName("Enes")
.setSurname("Usta")
.setBirthYear(1998)
.build();CitizenValidator citizenValidator = new DefaultCitizenValidator();
boolean isValidId = citizenValidator.validate(citizen);}
}
```##### License
This code is under the **MIT**
> It's open source. Feel free.