Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Similar to the @Category transform, I'd like to have a local transform for utility classes. Consider the following:
@Namespace class C { int constant = 1 def method() { // ... } }
This would be Groovy shorthand for the canonical "utility class":
final class C { private C() { throw new AssertionError() } public static final int constant = 1 static method { // ... } }
Update: Like trait or record, we might consider taking this to the next step:
namespace C { int constant = 1 def method() { // ... } }