dschulten / hydra-java

Annotate your Java beans and serialize them as json-ld with hydra
Apache License 2.0
107 stars 27 forks source link

Made parameter maps generic #27

Closed pictin closed 6 years ago

pictin commented 7 years ago

Current version of PartialUriTemplate infers that parameter map must be of type <String, Object>. If another type of map, like Map<String, String> is supplied, a different method expand(Object... parameters) quietly takes over, and the result gets totally wrong.

According to the source code (and general developer's practices) there's no reason why parameter map can not be generic like Map<String, ?> Updated method will work with other maps like Map<String, String> and Map<String, Integer> in the same way original Map<String, Object> have worked.

P.S. Struggling with Map<String, String> in my code took me a full day. Fixing PartialUriTemplate took just 5 minutes :)

dschulten commented 6 years ago

Excellent, thank you!