Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Getters for IBANValidator's RegexValidator its patterns #29

Conversation

arnaudfnr
Copy link

Hi,

For a project I need to have access to the regex used to validate IBANs, therefore I added a couple of getters to make it possible.

@sebbASF I saw that you have been contributing quite a lot recently, have you planned to perform a release ? If yes, do you have an estimation of its date please ? It would be nice if these changes could be added 🙏

@sebbASF
Copy link
Contributor

sebbASF commented Jul 31, 2020

Note that the validator field is package-protected so you could get access from the relevant package (as is done by the test class).
Obviously that is not suitable for a project that is publicly available.

* @return the array of <code>patterns</code> used to validate values.
*/
public Pattern[] getPatterns() {
return patterns;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method must return a copy of the the patterns otherwise the caller can mutate the array.

@garydgregory
Copy link
Member

@arnaudfnr
Done in git master, with a defensive copy of the pattern array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants