Closed jmyounker closed 9 years ago
@jmyounker thank you for the pull request. I was thinking some time back to add random generation. Will review the pull request and merge it soon.
Please let me know if there is anything you'd like updated or changed.
@jmyounker Thank you very much. Merged will release new version of the library today. v3.1.0 is available now.
Hi, I've got some some changes which may others may find useful. Our primary use for this library has been generating test data. As such, we've needed IBANs with one or more fields randomly filled.
This is done in the
Iban.Builder
class. When the newbuildRandom()
method is called it uses the Bban definitions to supply random values for any fields which have not been supplied. So, if you want to generate an Austrian IBAN for the bank with code11111
you call:new Iban.Builder().countryCode(CountryCode.AT).bankCode("11111").randomIban()
The call
new Iban.Builder().randomIban()
generates a completely random Iban.There are convenience methods in the
Iban
class. These areIban random()
andIban random(CountryCode)
.