aesteve / vertx-groovy-java

Use vertx in Groovy but with the Java API (and see what's wrong)
0 stars 0 forks source link

JsonObject to Map #2

Open vietj opened 8 years ago

vietj commented 8 years ago

Use this:

to provide an asType extension method that transforms a JsonObject into a Map

aesteve commented 8 years ago

Obviously we'll be using extensions instead of metaclass programming :)

Metaclass are just there to show a possible implementation next to the problem, the real code would lie within an extension of course.

What I'm more insterested in is to validate the extension implementation. For instance here, the implementation of asType you're describing would be this one. But it relies on the name a JsonObject property, which is kinda meh :\