Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5096

@Immutable should have an extensible way to be informed of classes that are "deemed" Immutable

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.0-beta-3, 1.8.7
    • None
    • None

    Description

      The @Immutable annotation has a list of known "effectively immutable" classes. There should be some way to provide an extensible list of class names or "vouch" for a particular field's immutability.

      Possible ways to implement might look like the examples below:

      @Immutable class Person {
        String name
        @KnownImmutable MyUuid id
      }
      
      @KnownImmutables([MyDate, MyUuid])
      @Immutable class Person {
        String name
        MyDate dob
        MuUuid id
      }
      

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: