|
|
-
Protocol messages for which the response is null
Jeff Hammerbacher 2010-05-18, 07:20
Hey,
I've got a protocol where many of the methods which do not return a response; that is, they have "response": "null" in the protocol definition. When I use the Java Specific compiler, I end up with a method whose return type is java.lang.Void, rather than void. If, in the server implementation, I use "void" rather than "Void" as the return type of the method, javac complains that I have not implemented the interface correctly. Yet if I make Void the return type of the implementing method, I can't figure out what to return! new Void() doesn't work, and return; doesn't work either.
My knowledge of Java is quite limited, so any guidance on what to do here would be helpful.
Thanks, Jeff
-
Re: Protocol messages for which the response is null
Ryan Rawson 2010-05-18, 07:29
For the mysterious Void object type use 'null'.
Pretty non obvious.. dog!
On May 18, 2010 12:21 AM, "Jeff Hammerbacher" <[EMAIL PROTECTED]> wrote:
Hey,
I've got a protocol where many of the methods which do not return a response; that is, they have "response": "null" in the protocol definition. When I use the Java Specific compiler, I end up with a method whose return type is java.lang.Void, rather than void. If, in the server implementation, I use "void" rather than "Void" as the return type of the method, javac complains that I have not implemented the interface correctly. Yet if I make Void the return type of the implementing method, I can't figure out what to return! new Void() doesn't work, and return; doesn't work either.
My knowledge of Java is quite limited, so any guidance on what to do here would be helpful.
Thanks, Jeff
|
|