windy1/google-places-api-java — pull request #3 by pauloubuntu (2014-10-31 04:05:21+00:00)
Title: Added Type Parameter to restrict result places search

Hi @windy1

How are you doing ? I hope everything is fine.

I'd like to thank you for all your efforts on doing this great job. You're right, there was a severe lack of a decent Java wrapper around Google Places API.

I've been using this for a few weeks and I noticed that there wasn't a way to request the nearby places restricting by the types parameters, although we can use the Param class and set it anyway. So I took the liberty to add this functionality to your code.

So I basically inherited the Param class and create a new one which is capable of dealing with types collections. The good point about this implementation is that it hasn't changed any method signature of yours.

Here is a code snippet that shows how to use it.

google.getNearbyPlaces(
TEST_PLACE_LAT,
TEST_PLACE_LNG,
GooglePlaces.MAXIMUM_RADIUS,
GooglePlaces.TypeParam.name(GooglePlaces.STRING_TYPES).value(
Arrays.asList(GooglePlaces.TYPE_BAR,GooglePlaces.TYPE_RESTAURANT)
)
)

I hope you like it and if you do like it, please accept my pull request =)

Best Regards

Paulo Miguel Almeida Rodenas