turkish-citizen-validator

This library uses soap protocol to validate turkish citizen id number

License

License

GroupId

GroupId

com.github.enesusta
ArtifactId

ArtifactId

turkish-citizen-validator
Last Version

Last Version

1.3.3
Release Date

Release Date

Type

Type

jar
Description

Description

turkish-citizen-validator
This library uses soap protocol to validate turkish citizen id number
Project URL

Project URL

https://github.com/enesusta/turkish-citizen-validator
Source Code Management

Source Code Management

http://github.com/enesusta/turkish-citizen-validator

Download turkish-citizen-validator

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.enesusta/turkish-citizen-validator/ -->
<dependency>
    <groupId>com.github.enesusta</groupId>
    <artifactId>turkish-citizen-validator</artifactId>
    <version>1.3.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.enesusta/turkish-citizen-validator/
implementation 'com.github.enesusta:turkish-citizen-validator:1.3.3'
// https://jarcasting.com/artifacts/com.github.enesusta/turkish-citizen-validator/
implementation ("com.github.enesusta:turkish-citizen-validator:1.3.3")
'com.github.enesusta:turkish-citizen-validator:jar:1.3.3'
<dependency org="com.github.enesusta" name="turkish-citizen-validator" rev="1.3.3">
  <artifact name="turkish-citizen-validator" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.enesusta', module='turkish-citizen-validator', version='1.3.3')
)
libraryDependencies += "com.github.enesusta" % "turkish-citizen-validator" % "1.3.3"
[com.github.enesusta/turkish-citizen-validator "1.3.3"]

Dependencies

compile (2)

Group / Artifact Type Version
javax.xml.soap : javax.xml.soap-api jar 1.4.0
com.sun.xml.messaging.saaj : saaj-impl jar 1.5.1

Project Modules

There are no modules declared in this project.

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.

Versions

Version
1.3.3
1.3.2