Is this a reasonable way to convert?
Yes
Can I keep all of my public methods and and fields in Java? Groovy is "just" a superset, right?
Almost a superset, but not exactly. For example, ==
in Groovy calls the .equals
method, but in Java it checks whether 2 references refer to the same object. Another example is that Groovy does not support this syntax for constructing arrays
Object[] objs = new Object[] { 1, 2, 4 }
A final example is that when an overloaded method is called, Groovy uses the runtime type of the parameters when choosing which method to invoke, whereas Java uses the compile-time parameter types. This page has a fairly comprehensive list of differences between the two languages.
What kinds of things would you not do in Groovy, but prefer Java instead?
I write everything in Groovy, because I'm much more productive with Groovy than Java, and I enjoy Groovy programming a lot more. I would only use Java if there was a performance problem with some code AND I could demonstrate that writing it in Java resolved the problem. In practice, this has never actually happened to me.
There may also be socio-political reasons to use Java, e.g. some code needs to be maintained by many people some of which don't know Groovy and don't want to learn it.