Came across code recently in Wicket like so:
Form<?> form = new Form<Void>("form")
Can anyone explain the usage of the Void type here? First time I’ve seen that type being used actually. Is it used t all outside of Wicket?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it’s used outside of Wicket. For example, when a method takes a
Callable<V>as argument, and my Callable doesn’t return anything, I use aCallable<Void>.Voidis thus used to indicate that some parameterized method doesn’t return anything.In this particular case, according to the documentation, it’s used to indicate that the Form doesn’t have any model object. The only valid value of the Void type is
null.