Today I've added a extra security check behind my login forms, to slow down brute force attacks. I've got multiple login forms and made a nice easy to call function that does all the checking and then returns the result.
public static ValidateLoginResult validateLogin(HttpServletRequest request, String email, String password) {
The problem is the result is not a single value, the result consists of:
boolean ok
String errorMessage
boolean displayCaptcha
For this I created a new class. This all works fine.
But I often have handy utility functions that return multiple values and start to find it a bit annoying to create a new class for the result every time.
Is there a better way of returning multiple values? Or am I just lazy? :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…