public class SvNationalIdentificationNumberProvider extends Object implements NationalIdentificationNumberProvider
https://en.wikipedia.org/wiki/Personal_identity_number_(Sweden)
E.g. 870508-5853
The left part of the hyphen consists of the date of birth and the right part consist of three random numbers + one check digit.
Constructor and Description |
---|
SvNationalIdentificationNumberProvider(DateProducer dateProducer,
BaseProducer baseProducer,
NationalIdentificationNumberProperties.Property... properties) |
Modifier and Type | Method and Description |
---|---|
static int |
calculateChecksum(String nationalIdentificationNumber) |
NationalIdentificationNumber |
get() |
static boolean |
isValid(String nationalIdentificationNumber) |
void |
setIssueDate(LocalDate issueDate) |
void |
setSex(Person.Sex sex) |
void |
with(NationalIdentificationNumberProperties.Property[] properties) |
@Inject public SvNationalIdentificationNumberProvider(DateProducer dateProducer, BaseProducer baseProducer, NationalIdentificationNumberProperties.Property... properties)
public void with(NationalIdentificationNumberProperties.Property[] properties)
public NationalIdentificationNumber get()
get
in interface NationalIdentificationNumberProvider
get
in interface javax.inject.Provider<NationalIdentificationNumber>
public void setIssueDate(LocalDate issueDate)
setIssueDate
in interface NationalIdentificationNumberProvider
public void setSex(Person.Sex sex)
setSex
in interface NationalIdentificationNumberProvider
public static boolean isValid(String nationalIdentificationNumber)
nationalIdentificationNumber
- Personal Identity Numberpublic static int calculateChecksum(String nationalIdentificationNumber)
Copyright © 2020. All rights reserved.