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

Allow conversion from Map to interface

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-RC-1
    • None
    • None

    Description

      Comparable to GROOVY-1439 I think about a map where each key represents a method name and each value a closure that is called for the method of the interface.

      example:

      interface Foo {
      def aMethod();
      }

      def myImplementation = [aMethod:

      {1}

      ] as Foo
      assert myImplementation instanceof Foo
      assert myImplementation.aMethod() == 1

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            blackdrag Jochen Theodorou
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: