Skip to content

This repository validates Turkish citizen number using SOAP Protocol

Notifications You must be signed in to change notification settings

enesusta/turkish-citizen-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central Issues

Quick Installation

If you are using Maven you can add the repository by adding the following XML to your project pom.xml file.

<dependency>
  <groupId>com.github.enesusta</groupId>
  <artifactId>turkish-citizen-validator</artifactId>
  <version>1.3.3</version>
</dependency>
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

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):
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.

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.

About

This repository validates Turkish citizen number using SOAP Protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages