Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Saw this in code...
Integer.parseInt(args[0])
It'd be much more groovy to type
args[0].toInteger()
etc
Or we could use the new 'as' operator to convert to a new type
args[0] as Integer
which could be implemented using a generic function
asType(String self, Class type) {
switch (type) {
case Integer:
return Integer.parse(self)
}
...
}
etc