Pretty-printing as utility methods#4
Pretty-printing as utility methods#4barend merged 2 commits intobarend:masterfrom TheConstructor:master
Conversation
- Removed redundant checks in constructor
|
Thanks! The code looks good and the tests are passing, that's all cool. It's been a while since I looked at this library, I need to sleep on your changes. The functionality is fine and I'm happy to include it, but the thing that I'm pondering is whether I want to keep the toPretty/toPlain methods in At the time I got distracted I was exploring ways to facilitate input processing. This factors into that. There's the If I don't have an epiphany on that front overnight, I'll merge your pull request and prepare a new release to maven central. |
Pretty-printing as utility methods
|
Thank you! |
These two commits aim to better support evaluation of user input data.
CountryCodes.SHORTEST_IBAN_LENGTHandCountryCodes.LONGEST_IBAN_LENGTHcan be used to find the right dimension for input fieldsIBAN.toPretty()reformats user-input without validation to assist user in finding typos (especially if user entered IBAN without spaces)IBAN-constructor asCountryCodes.getLengthForCountryCode()already rejects he filtered values and some moreIBAN-constructor to a minimum of 5 asCountryCodes.getLengthForCountryCode()may some day return 14 and this way only one place needy to be changed; 4 could be argued as well, but I guess there will never be a country with just one bank account...String.replaceAll()to pre-compiled pattern (same semantics, possibly faster)