aesteve / nubes

Annotation layer on top of Vert.x 3
Apache License 2.0
121 stars 35 forks source link

Refactor Cookie handling #16

Closed aesteve closed 9 years ago

aesteve commented 9 years ago

Existing now :

@UsesCookie
public void myMethod(RoutingContext context) {
  routingContext.getCookie("bleh");
}

That's probably not consistent with dependency injection used everywhere else.

Keep this annotation if some user just wants to set a cookie but won't read any (and rename it @SetsCookie ?)

Moreover provide another annotation :

public void myMethod(@Cookie("myCookie") Cookie cookie)

If the parameter type is Cookie then simply inject context.getCookie(annotation.value()) else if it's a String inject context.getCookie(annotation.value())?.value()

aesteve commented 9 years ago

Done